Re: TODO item: Allow more complex user/database default GUC settings

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Gurjeet Singh <singh(dot)gurjeet(at)gmail(dot)com>, Bernd Helmle <mailings(at)oopsware(dot)de>, Robert Haas <robertmhaas(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: TODO item: Allow more complex user/database default GUC settings
Date: 2009-09-30 15:50:25
Message-ID: 20090930155025.GD8280@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane escribió:
> Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:
> > And here's the last necessary bit, which is pg_dump support for all
> > this.
>
> > + /* Dump role/database settings */
> > + if (!tablespaces_only)
> > + {
> > + if (server_version >= 80500)
> > + dumpDbRoleConfig(conn);
> > + }
>
> Hmm ... I would kind of think that --roles-only should suppress this too.
> Otherwise you're going to be dumping commands that might refer to
> nonexistent databases.

Those double negatives are confusing as hell. I propose to add
something like this:

do_tablespaces = true;
do_databases = true;
do_roles = true;
if (globals_only)
do_databases = false;
if (tablespaces_only)
{
do_roles = false;
do_databases = false;
}
if (roles_only)
{
do_databases = false;
do_tablespaces = false;
}

Then we can have the new block this way:

/* Dump role/database settings */
if (do_databases && do_roles)
{
if (server_version >= 80500)
dumpDbRoleConfig(conn);
}

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2009-09-30 16:00:46 Re: TODO item: Allow more complex user/database default GUC settings
Previous Message Heikki Linnakangas 2009-09-30 15:45:49 Re: Hot Standby on git