Re: [HACKERS] Add support to COMMENT ON CURRENT DATABASE - Mailing list pgsql-hackers

From Ashutosh Bapat
Subject Re: [HACKERS] Add support to COMMENT ON CURRENT DATABASE
Date
Msg-id CAFjFpRe0JVVVL5ZnNH226NPmgEBRnhQq6uxKr23sr7z_+HdPfQ@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] Add support to COMMENT ON CURRENT DATABASE  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Responses Re: [HACKERS] Add support to COMMENT ON CURRENT DATABASE  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
List pgsql-hackers
On Tue, Jan 3, 2017 at 9:18 PM, Peter Eisentraut
<peter.eisentraut@2ndquadrant.com> 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] https://www.postgresql.org/message-id/20150317171836.GC10492@momjian.us
>
> The syntax we have used for the user/role case is ALTER USER
> CURRENT_USER, not ALTER CURRENT USER, so this should be done in the same
> way for databases.  Eventually, we'll also want ALTER DATABASE
> current_database, and probably not ALTER CURRENT DATABASE, etc.

We don't allow a user to be created as CURRENT_USER, but we allow a
database to be created with name CURRENT_DATABASE.
postgres=# create user current_user;
ERROR:  CURRENT_USER cannot be used as a role name here
LINE 1: create user current_user;                   ^
postgres=# create database current_database;
CREATE DATABASE

We will need to make CURRENT_DATABASE a reserved keyword. But I like
this idea more than COMMENT ON CURRENT DATABASE.


--
Best Wishes,
Ashutosh Bapat
EnterpriseDB Corporation
The Postgres Database Company



pgsql-hackers by date:

Previous
From: Ashutosh Bapat
Date:
Subject: Re: [HACKERS] Add support to COMMENT ON CURRENT DATABASE
Next
From: Amit Langote
Date:
Subject: Re: [HACKERS] Declarative partitioning - another take