Re: Bug in -c CLI option of pg_dump/pg_restore
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>, Guillaume Lelarge <guillaume@lelarge.info>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2012-10-20T18:28:30Z
Lists: pgsql-hackers
Attachments
- fix-pg_dump-clean-mode.patch (text/x-patch) patch
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. regards, tom lane
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Rewrite --section option to decouple it from --schema-only/--data-only.
- 4317e0246c64 9.2.0 cited