Re: Add support to COMMENT ON CURRENT DATABASE

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
Cc: Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>, Fabrízio Mello <fabriziomello(at)gmail(dot)com>, Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add support to COMMENT ON CURRENT DATABASE
Date: 2017-01-10 19:08:11
Message-ID: CA+TgmobWQ=rc9PNGsnERsDEJ-jo5oCsavyKFWnPVZFdb4NrqOQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jan 9, 2017 at 3:14 PM, Peter Eisentraut
<peter(dot)eisentraut(at)2ndquadrant(dot)com> 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 those, though.

> And it would also set a precedent for similar commands, such as current
> user/role.

True. Maybe it's a GOOD precedent, though.

> Plus support in psql, pg_dump, etc. would get more complicated.

I'm not totally convinced...

> Instead, it would be simpler to define a grammar symbol like
>
> database_name: ColId | CURRENT_DATABASE
>
> and make a small analogous change in objectaddress.c and you're done.
>
> Compare rolespec in gram.y.

...but that's certainly an existing precedent for your proposal.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2017-01-10 19:16:54 Re: Cache Hash Index meta page.
Previous Message Robert Haas 2017-01-10 19:03:59 Re: Replication/backup defaults