Re: Can pg_dump make use of CURRENT/SESSION_USER
От | Robert Haas |
---|---|
Тема | Re: Can pg_dump make use of CURRENT/SESSION_USER |
Дата | |
Msg-id | CA+TgmobVsQvRB8Mb8xQYDPfYEOn72_=wN_15ycuECBg38z=abg@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Can pg_dump make use of CURRENT/SESSION_USER (Fabrízio de Royes Mello <fabriziomello@gmail.com>) |
Ответы |
Re: Can pg_dump make use of CURRENT/SESSION_USER
|
Список | pgsql-hackers |
On Sat, Apr 25, 2015 at 8:05 AM, Fabrízio de Royes Mello <fabriziomello@gmail.com> wrote: >> >> > If we ever implement something like >> >> > >> >> > COMMENT ON CURRENT_DATABASE IS ... >> >> > >> >> > it will be useful, because you will be able to restore a dump into >> >> > another database and have the comment apply to the target database. >> > >> > I think it's simple to implement, but how about pg_dump... we need to >> > add >> > new option (like --use-current-database) or am I missing something ? >> >> I think we'd just change it to use the new syntax, full stop. I see >> no need for an option. > > I'm returning on this... > > What's the reasonable syntaxes? > > COMMENT ON CURRENT DATABASE IS 'text'; > > or > > COMMENT ON DATABASE { CURRENT_DATABASE | object_name } IS 'text'; The second one would require making CURRENT_DATABASE a reserved keyword, and I'm not keen to create any more of those. I like the first one. The other alternative that may be worth considering is: COMMENT ON CURRENT_DATABASE IS 'text'; That doesn't require making CURRENT_DATABASE a reserved keyword, but it does require making it a keyword, and it doesn't look very SQL-ish. Still, we have a bunch of other CURRENT_FOO keywords. But I'm inclined to stick with your first proposal. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company
В списке pgsql-hackers по дате отправления: