Re: [HACKERS] Add support to COMMENT ON CURRENT DATABASE

2017-02-10 Thread Peter Eisentraut
On 1/28/17 1:33 PM, Fabrízio de Royes Mello wrote: > I did what you suggested making CURRENT_DATABASE reserved but I got the > following error during the bootstrap: current_database is also used as a function name, so you need to do some parser work to get it working in all the right ways. Hard

Re: [HACKERS] Add support to COMMENT ON CURRENT DATABASE

2017-01-30 Thread Michael Paquier
On Sun, Jan 29, 2017 at 3:33 AM, Fabrízio de Royes Mello wrote: > On Sat, Jan 28, 2017 at 4:26 PM, Fabrízio de Royes Mello > wrote: >> On Fri, Jan 27, 2017 at 8:53 PM, Peter Eisentraut >> wrote: >> > >> > On

Re: [HACKERS] Add support to COMMENT ON CURRENT DATABASE

2017-01-28 Thread Fabrízio de Royes Mello
On Sat, Jan 28, 2017 at 4:26 PM, Fabrízio de Royes Mello < fabriziome...@gmail.com> wrote: > > > > On Fri, Jan 27, 2017 at 8:53 PM, Peter Eisentraut < peter.eisentr...@2ndquadrant.com> wrote: > > > > On 1/26/17 1:20 PM, Fabrízio de Royes Mello wrote: > > > Ok, but doing in that way the syntax

Re: [HACKERS] Add support to COMMENT ON CURRENT DATABASE

2017-01-28 Thread Fabrízio de Royes Mello
On Fri, Jan 27, 2017 at 8:53 PM, Peter Eisentraut < peter.eisentr...@2ndquadrant.com> wrote: > > On 1/26/17 1:20 PM, Fabrízio de Royes Mello wrote: > > Ok, but doing in that way the syntax would be: > > > > COMMENT ON DATABASE CURRENT_DATABASE IS 'comment'; > > Yes, that's right. We also have

Re: [HACKERS] Add support to COMMENT ON CURRENT DATABASE

2017-01-27 Thread Peter Eisentraut
On 1/26/17 1:20 PM, Fabrízio de Royes Mello wrote: > Ok, but doing in that way the syntax would be: > > COMMENT ON DATABASE CURRENT_DATABASE IS 'comment'; Yes, that's right. We also have ALTER USER CURRENT_USER already. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL

Re: [HACKERS] Add support to COMMENT ON CURRENT DATABASE

2017-01-26 Thread Fabrízio de Royes Mello
On Mon, Jan 9, 2017 at 6:14 PM, Peter Eisentraut < peter.eisentr...@2ndquadrant.com> wrote: > > On 1/9/17 1:34 PM, Robert Haas wrote: > > On Fri, Jan 6, 2017 at 7:29 PM, Peter Eisentraut > > wrote: > >> On 1/3/17 11:52 PM, Ashutosh Bapat wrote: > >>> We will need

Re: [HACKERS] Add support to COMMENT ON CURRENT DATABASE

2017-01-10 Thread Robert Haas
On Mon, Jan 9, 2017 at 3:14 PM, Peter Eisentraut wrote: > To achieve consistent support for specifying the current database, we > would need to change the grammar for every command involving databases. I wouldn't have thought there would be all that many of

Re: [HACKERS] Add support to COMMENT ON CURRENT DATABASE

2017-01-09 Thread Peter Eisentraut
On 1/9/17 2:52 PM, Alvaro Herrera wrote: > CURRENT_USER is a standards-mandated keyword, but CURRENT_DATABASE is > not. The closest thing SQL has is CURRENT_CATALOG, which is the string > that identifies the "current default catalog". This would lead us to > COMMENT ON DATABASE

Re: [HACKERS] Add support to COMMENT ON CURRENT DATABASE

2017-01-09 Thread Bruce Momjian
On Mon, Jan 9, 2017 at 04:52:46PM -0300, Alvaro Herrera wrote: > Bruce Momjian wrote: > > On Mon, Jan 9, 2017 at 01:34:03PM -0500, Robert Haas wrote: > > > On Fri, Jan 6, 2017 at 7:29 PM, Peter Eisentraut > > > wrote: > > > > On 1/3/17 11:52 PM, Ashutosh Bapat

Re: [HACKERS] Add support to COMMENT ON CURRENT DATABASE

2017-01-09 Thread Peter Eisentraut
On 1/9/17 1:34 PM, Robert Haas wrote: > On Fri, Jan 6, 2017 at 7:29 PM, Peter Eisentraut > wrote: >> On 1/3/17 11:52 PM, Ashutosh Bapat wrote: >>> We will need to make CURRENT_DATABASE a reserved keyword. But I like >>> this idea more than COMMENT ON CURRENT

Re: [HACKERS] Add support to COMMENT ON CURRENT DATABASE

2017-01-09 Thread Alvaro Herrera
Bruce Momjian wrote: > On Mon, Jan 9, 2017 at 01:34:03PM -0500, Robert Haas wrote: > > On Fri, Jan 6, 2017 at 7:29 PM, Peter Eisentraut > > wrote: > > > On 1/3/17 11:52 PM, Ashutosh Bapat wrote: > > >> We will need to make CURRENT_DATABASE a reserved keyword.

Re: [HACKERS] Add support to COMMENT ON CURRENT DATABASE

2017-01-09 Thread Bruce Momjian
On Mon, Jan 9, 2017 at 01:34:03PM -0500, Robert Haas wrote: > On Fri, Jan 6, 2017 at 7:29 PM, Peter Eisentraut > wrote: > > On 1/3/17 11:52 PM, Ashutosh Bapat wrote: > >> We will need to make CURRENT_DATABASE a reserved keyword. But I like > >> this idea more

Re: [HACKERS] Add support to COMMENT ON CURRENT DATABASE

2017-01-09 Thread Robert Haas
On Fri, Jan 6, 2017 at 7:29 PM, Peter Eisentraut wrote: > On 1/3/17 11:52 PM, Ashutosh Bapat wrote: >> We will need to make CURRENT_DATABASE a reserved keyword. But I like >> this idea more than COMMENT ON CURRENT DATABASE. > > We already have the reserved key

Re: [HACKERS] Add support to COMMENT ON CURRENT DATABASE

2017-01-06 Thread Peter Eisentraut
On 1/3/17 11:52 PM, Ashutosh Bapat wrote: > We will need to make CURRENT_DATABASE a reserved keyword. But I like > this idea more than COMMENT ON CURRENT DATABASE. We already have the reserved key word CURRENT_CATALOG, which is the standard spelling. But I wouldn't be bothered if we made

Re: [HACKERS] Add support to COMMENT ON CURRENT DATABASE

2017-01-03 Thread Ashutosh Bapat
On Tue, Jan 3, 2017 at 10:09 PM, Robert Haas wrote: > On Tue, Jan 3, 2017 at 12:06 AM, Ashutosh Bapat > wrote: >> Instead of changing get_object_address_unqualified(), >> get_object_address_unqualified() and pg_get_object_address(), should

Re: [HACKERS] Add support to COMMENT ON CURRENT DATABASE

2017-01-03 Thread Ashutosh Bapat
On Tue, Jan 3, 2017 at 9:18 PM, Peter Eisentraut wrote: > On 12/30/16 9:28 PM, Fabrízio de Royes Mello wrote: >> The attached patch is reworked from a previous one [1] to better deal >> with get_object_address and pg_get_object_address. >> >> Regards, >> >> [1]

Re: [HACKERS] Add support to COMMENT ON CURRENT DATABASE

2017-01-03 Thread Ashutosh Bapat
On Tue, Jan 3, 2017 at 6:40 PM, Fabrízio de Royes Mello wrote: > Hi Ashutosh, > > First of all thanks for your review. > > > On Tue, Jan 3, 2017 at 3:06 AM, Ashutosh Bapat > wrote: >> >> The patch has white space error >> git apply

Re: [HACKERS] Add support to COMMENT ON CURRENT DATABASE

2017-01-03 Thread Robert Haas
On Tue, Jan 3, 2017 at 12:06 AM, Ashutosh Bapat wrote: > Instead of changing get_object_address_unqualified(), > get_object_address_unqualified() and pg_get_object_address(), should > we just stick get_database_name(MyDatabaseId) as object name in > gram.y? No.

Re: [HACKERS] Add support to COMMENT ON CURRENT DATABASE

2017-01-03 Thread Peter Eisentraut
On 12/30/16 9:28 PM, Fabrízio de Royes Mello wrote: > The attached patch is reworked from a previous one [1] to better deal > with get_object_address and pg_get_object_address. > > Regards, > > [1] https://www.postgresql.org/message-id/20150317171836.gc10...@momjian.us The syntax we have used

Re: [HACKERS] Add support to COMMENT ON CURRENT DATABASE

2017-01-03 Thread Fabrízio de Royes Mello
Hi Ashutosh, First of all thanks for your review. On Tue, Jan 3, 2017 at 3:06 AM, Ashutosh Bapat < ashutosh.ba...@enterprisedb.com> wrote: > > The patch has white space error > git apply /mnt/hgfs/tmp/comment_on_current_database_v1.patch > /mnt/hgfs/tmp/comment_on_current_database_v1.patch:52:

Re: [HACKERS] Add support to COMMENT ON CURRENT DATABASE

2017-01-02 Thread Ashutosh Bapat
The patch has white space error git apply /mnt/hgfs/tmp/comment_on_current_database_v1.patch /mnt/hgfs/tmp/comment_on_current_database_v1.patch:52: trailing whitespace. * schema-qualified or catalog-qualified. warning: 1 line adds whitespace errors. The patch compiles clean, regression is