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