From: | Guillaume Lelarge <guillaume(at)lelarge(dot)info> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Robert Haas <robertmhaas(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Bug in -c CLI option of pg_dump/pg_restore |
Date: | 2012-10-20 21:41:15 |
Message-ID: | 1350769275.2116.19.camel@localhost.localdomain |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Sat, 2012-10-20 at 14:28 -0400, Tom Lane wrote:
> I wrote:
> > It looks like I broke this in commit
> > 4317e0246c645f60c39e6572644cff1cb03b4c65, because I removed this from
> > _tocEntryRequired():
>
> > - /* Ignore DATABASE entry unless we should create it */
> > - if (!ropt->createDB && strcmp(te->desc, "DATABASE") == 0)
> > - return 0;
>
> Actually, on closer look, this change provides the foundation needed to
> do more than just fix this bug. We can also make the combination
> "pg_dump -C -c" work sanely, which it never has before. I propose that
> we fix this with the attached patch (plus probably some documentation
> changes, though I've not looked yet to see what the docs say about it).
> With this fix, the output for "-C -c" looks like
>
> DROP DATABASE regression;
> CREATE DATABASE regression WITH ...
> ALTER DATABASE regression OWNER ...
> \connect regression
> ... etc ...
>
> which seems to me to be just about exactly what one would expect.
>
> The patch also gets rid of a kluge in PrintTOCSummary, which was needed
> because of the old coding in _tocEntryRequired(), but no longer is.
>
Thanks a lot.
--
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com
From | Date | Subject | |
---|---|---|---|
Next Message | Albert Cervera i Areny | 2012-10-21 05:50:47 | Re: [PATCH] Enforce that INSERT...RETURNING preserves the order of multi rows |
Previous Message | Daniel Farina | 2012-10-20 19:49:23 | Re: patch to add \watch to psql |