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

Поиск
Список
Период
Сортировка
От Fabrízio de Royes Mello
Тема Re: [HACKERS] Add support to COMMENT ON CURRENT DATABASE
Дата
Msg-id CAFcNs+rPArkJ8mZVEcevAY0=yPKH0gEKiHkOKey8YDV8mO_pMQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [HACKERS] Add support to COMMENT ON CURRENT DATABASE  (Fabrízio de Royes Mello <fabriziomello@gmail.com>)
Ответы Re: [HACKERS] Add support to COMMENT ON CURRENT DATABASE  (Michael Paquier <michael.paquier@gmail.com>)
Re: [HACKERS] Add support to COMMENT ON CURRENT DATABASE  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Список pgsql-hackers


On Sat, Jan 28, 2017 at 4:26 PM, Fabrízio de Royes Mello <fabriziomello@gmail.com> wrote:
>
>
>
> On Fri, Jan 27, 2017 at 8:53 PM, Peter Eisentraut <peter.eisentraut@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 ALTER USER CURRENT_USER already.
> >
>
> Ok, but if we make CURRENT_DATABASE reserved wouldn't it lead us to a conflict with current_database() function?
>

I did what you suggested making CURRENT_DATABASE reserved but I got the following error during the bootstrap:


The files belonging to this database system will be owned by user "fabrizio".
This user must also own the server process.

The database cluster will be initialized with locale "en_US.UTF-8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

creating directory /tmp/master5432 ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting dynamic shared memory implementation ... posix
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... 2017-01-28 16:19:07.994 BRST [18252] FATAL:  syntax error at or near "current_database" at character 120
2017-01-28 16:19:07.994 BRST [18252] STATEMENT:
    /*
     * 5.2
     * INFORMATION_SCHEMA_CATALOG_NAME view
     */
   
    CREATE VIEW information_schema_catalog_name AS
        SELECT CAST(current_database() AS sql_identifier) AS catalog_name;
   
child process exited with exit code 1
initdb: removing data directory "/tmp/master5432"
pg_ctl: directory "/tmp/master5432" does not exist
psql: could not connect to server: No such file or directory
    Is the server running locally and accepting
    connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
psql: could not connect to server: No such file or directory
    Is the server running locally and accepting
    connections on Unix domain socket "/tmp/.s.PGSQL.5432"?


If I use CURRENT_CATALOG instead this error doesn't occurs of course...


--
Fabrízio de Royes Mello
Consultoria/Coaching PostgreSQL
>> Timbira: http://www.timbira.com.br
>> Blog: http://fabriziomello.github.io
>> Linkedin: http://br.linkedin.com/in/fabriziomello
>> Twitter: http://twitter.com/fabriziomello
>> Github: http://github.com/fabriziomello

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Fabrízio de Royes Mello
Дата:
Сообщение: Re: [HACKERS] Add support to COMMENT ON CURRENT DATABASE
Следующее
От: Gavin Flower
Дата:
Сообщение: Re: [HACKERS] proposal: EXPLAIN ANALYZE formatting