Re: Can pg_dump make use of CURRENT/SESSION_USER - Mailing list pgsql-hackers

From Fabrízio de Royes Mello
Subject Re: Can pg_dump make use of CURRENT/SESSION_USER
Date
Msg-id CAFcNs+oqJh=ygqvDoz0q+t6JoDj-_q5W1-9wie5TYVSxS6XeOg@mail.gmail.com
Whole thread Raw
In response to Re: Can pg_dump make use of CURRENT/SESSION_USER  (Fabrízio de Royes Mello <fabriziomello@gmail.com>)
Responses Re: Can pg_dump make use of CURRENT/SESSION_USER
List pgsql-hackers
<div dir="ltr"><div class="gmail_extra">On Tue, Apr 28, 2015 at 1:07 PM, Fabrízio de Royes Mello <<a
href="mailto:fabriziomello@gmail.com">fabriziomello@gmail.com</a>>wrote:<br />><br />><br />> On Tue, Apr
28,2015 at 9:38 AM, Robert Haas <<a href="mailto:robertmhaas@gmail.com">robertmhaas@gmail.com</a>> wrote:<br
/>>><br />> > On Sat, Apr 25, 2015 at 8:05 AM, Fabrízio de Royes Mello<br />> > <<a
href="mailto:fabriziomello@gmail.com">fabriziomello@gmail.com</a>>wrote:<br />> > >> >> > If we
everimplement something like<br />> > >> >> ><br />> > >> >> > COMMENT ON
CURRENT_DATABASEIS ...<br />> > >> >> ><br />> > >> >> > it will be useful,
becauseyou will be able to restore a dump into<br />> > >> >> > another database and have the
commentapply to the target database.<br />> > >> ><br />> > >> > I think it's simple to
implement,but how about pg_dump... we need to<br />> > >> > add<br />> > >> > new option
(like--use-current-database) or am I missing something ?<br />> > >><br />> > >> I think we'd
justchange it to use the new syntax, full stop.  I see<br />> > >> no need for an option.<br />> >
><br/>> > > I'm returning on this...<br />> > ><br />> > > What's the reasonable
syntaxes?<br/>> > ><br />> > > COMMENT ON CURRENT DATABASE IS 'text';<br />> > ><br />>
>> or<br />> > ><br />> > > COMMENT ON DATABASE { CURRENT_DATABASE | object_name } IS
'text';<br/>> ><br />> > The second one would require making CURRENT_DATABASE a reserved<br />> >
keyword,and I'm not keen to create any more of those.  I like the<br />> > first one.  The other alternative that
maybe worth considering is:<br />> ><br />> > COMMENT ON CURRENT_DATABASE IS 'text';<br />> ><br
/>>> That doesn't require making CURRENT_DATABASE a reserved keyword, but<br />> > it does require making
ita keyword, and it doesn't look very SQL-ish.<br />> > Still, we have a bunch of other CURRENT_FOO keywords.<br
/>>><br />> > But I'm inclined to stick with your first proposal.<br />> ><br />><br />>
Attachedthe patch to support "COMMENT ON CURRENT DATABASE IS ..." (including pg_dump).<br />><br />> On my next
sparetime I'll send the "ALTER ROLE ... IN CURRENT DATABASE" patch.<br />><br /><br /></div><div
class="gmail_extra">Lookingat the patch again I realize the code is very ugly, so I'll rework the patch.<br /><br
/></div><divclass="gmail_extra">Regards,<br /></div><div class="gmail_extra"><br />--<br />Fabrízio de Royes Mello<br
/>Consultoria/CoachingPostgreSQL<br />>> Timbira: <a
href="http://www.timbira.com.br">http://www.timbira.com.br</a><br/>>> Blog: <a
href="http://fabriziomello.github.io">http://fabriziomello.github.io</a><br/>>> Linkedin: <a
href="http://br.linkedin.com/in/fabriziomello">http://br.linkedin.com/in/fabriziomello</a><br/>>> Twitter: <a
href="http://twitter.com/fabriziomello">http://twitter.com/fabriziomello</a><br/>>> Github: <a
href="http://github.com/fabriziomello">http://github.com/fabriziomello</a></div></div>

pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: shared_libperl, shared_libpython
Next
From: Bruce Momjian
Date:
Subject: Re: pg_basebackup, tablespace mapping and path canonicalization