Re: Can pg_dump make use of CURRENT/SESSION_USER

From: Fabrízio de Royes Mello <fabriziomello(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Can pg_dump make use of CURRENT/SESSION_USER
Date: 2015-03-18 18:09:55
Message-ID: CAFcNs+qEMv2vnOgM09rpO4c1qJYCAfyPVQhh9_mZ6rn1vK6w7Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Mar 18, 2015 at 2:42 PM, Fabrízio de Royes Mello <
fabriziomello(at)gmail(dot)com> wrote:
>
>
>
> On Wed, Mar 18, 2015 at 2:24 PM, Robert Haas <robertmhaas(at)gmail(dot)com>
wrote:
> >
> > On Wed, Mar 18, 2015 at 1:23 PM, Fabrízio de Royes Mello
> > <fabriziomello(at)gmail(dot)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.
> >
>
> Ok.
>
>
> > >> > (Also, I wonder about
> > >> > ALTER USER foo IN DATABASE current_database ...
> > >> > because that will let us dump per-database user options too.)
> > >>
> > >> +1 for both of those ideas.
> > >
> > > Can you explain more about this idea?
> >
> > Uh, what do you want explained?
> >
>
> There's no need, sorry. I just misunderstood it first.
>
> I'll provide the patches.
>

Just one last doubt. Do we expose a new function called "current_database"
like "current_catalog", "current_user", ... ?

Regards,

--
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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2015-03-18 18:13:16 Re: Rethinking the parameter access hooks for plpgsql's benefit
Previous Message Alvaro Herrera 2015-03-18 18:04:17 Re: Add LINE: hint when schemaname.typename is a non-existent schema