Re: BUG #5488: pg_dump does not quote column names -> pg_restore may fail when upgrading

From: Jasen Betts <jasen(at)xnet(dot)co(dot)nz>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5488: pg_dump does not quote column names -> pg_restore may fail when upgrading
Date: 2010-06-11 11:30:33
Message-ID: hut6op$psj$1@reversiblemaps.ath.cx
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 2010-06-10, Stefan Kaltenbrunner <stefan(at)kaltenbrunner(dot)cc> wrote:
> Tom Lane wrote:
>> Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com> writes:
>>> On 10/06/10 16:21, Robert Haas wrote:
>>>> I do agree that the human readability of pg_dump is an asset in many
>>>> situations - I have often dumped out the DDL for particular objects
>>>> just to look at it, for example. However, I emphatically do NOT agree
>>>> that leaving someone with a 500MB dump file (or, for some people on
>>>> this list, a whole heck of a lot larger than that) that has to be
>>>> manually edited to reload is a useful behavior. It's a huge pain in
>>>> the neck.
>>
>>> Much easier to do a schema-only dump, edit that, and dump data separately.
>>
>> That gets you out of the huge-file-to-edit problem, but the performance
>> costs of restoring a separate-data dump are a pretty serious
>> disadvantage. We really should do something about that.
>
> well that is an argument for providing not only --schema-only and
> --data-only but rather three options one for the table definitions, one
> for the data and one for all the constraints and indexes. So basically
> what pg_dump is currently doing anyway but just exposed as flags.

You can extract those parts from a schema-only (or full) dump using sed

or you can just edit the schema-only dump and insert

\i datadump.sql

in the apropriate spot.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Curtis Stecke 2010-06-11 16:41:47 BUG #5499: SQL syntax bug
Previous Message Jasen Betts 2010-06-11 10:47:13 Re: BUG #5488: pg_dump does not quote column names -> pg_restore may fail when upgrading