Re: TODO item: Allow more complex user/database default GUC settings - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: TODO item: Allow more complex user/database default GUC settings
Date
Msg-id 20090930155025.GD8280@alvh.no-ip.org
Whole thread Raw
In response to Re: TODO item: Allow more complex user/database default GUC settings  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane escribió:
> Alvaro Herrera <alvherre@commandprompt.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


pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: Hot Standby on git
Next
From: Alvaro Herrera
Date:
Subject: Re: TODO item: Allow more complex user/database default GUC settings