Re: Can pg_dump make use of CURRENT/SESSION_USER

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: Can pg_dump make use of CURRENT/SESSION_USER
Date: 2015-03-17 17:24:59
Message-ID: 20150317172459.GM3636@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce Momjian wrote:
>
> Are there any use-cases for pg_dump to use CURRENT/SESSION_USER in its
> output, so that restores will not be hard-coded to the dump user? I
> didn't see any cases of that, but wanted to ask.

Good question. I don't know, probably not.

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.
(Also, I wonder about
ALTER USER foo IN DATABASE current_database ...
because that will let us dump per-database user options too.)

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2015-03-17 17:27:49 Re: Rethinking the parameter access hooks for plpgsql's benefit
Previous Message Alvaro Herrera 2015-03-17 17:22:27 Re: Strange assertion using VACOPT_FREEZE in vacuum.c