Skip site navigation (1) Skip section navigation (2)

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

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: Stefan Kaltenbrunner <stefan(at)kaltenbrunner(dot)cc>, Robert Haas <robertmhaas(at)gmail(dot)com>, Hartmut Goebel <h(dot)goebel(at)goebel-consult(dot)de>, Dimitri Fontaine <dfontaine(at)hi-media(dot)com>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Kevin Grittner <kevin(dot)grittner(at)wicourts(dot)gov>, Stephen Frost <sfrost(at)snowman(dot)net>, pgsql-bugs <pgsql-bugs(at)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: BUG #5488: pg_dump does not quote column names -> pg_restore may fail when upgrading
Date: 2010-06-10 13:47:58
Message-ID: 201006101347.o5ADlwF28358@momjian.us (view raw or flat)
Thread:
Lists: pgsql-bugs
Magnus Hagander wrote:
> On Thu, Jun 10, 2010 at 15:35, Stefan Kaltenbrunner
> <stefan(at)kaltenbrunner(dot)cc> wrote:
> > Robert Haas wrote:
> >>
> >> On Thu, Jun 10, 2010 at 9:02 AM, Stefan Kaltenbrunner
> >> <stefan(at)kaltenbrunner(dot)cc> wrote:
> >>>
> >>> I for myself would be rather annoyed if we started quoting all column
> >>> names
> >>> in our dumps. This is seriously hampering readability and while it is
> >>> already annoying that pg_dump output is slightly different from the
> >>> original
> >>> DDL used this would make it far worse.
> >>
> >> It's only been proposed to make it an option, not to shove it down
> >> anyone's throat.
> >
> > that will pretty much defeat the purpose for most use cases i guess because
> > people will dump with the defaults and only discover the problem after the
> > fact.
> 
> Well, if you dump in custom format, it could be useful to be able to
> do this on pg_restore time. Not having followed this thread in detail,
> but would that work? That would be a much more useful option...

I don't think so because much of the quoting has to be done in the
backend, and it would be hard for pg_dump to munge the dump file before
sending it to the backend --- it doesn't have enough knowledge, I am
afraid.  It could try targeting just new keywords, but I am worried that
would cause more problems than it fixes.

-- 
  Bruce Momjian  <bruce(at)momjian(dot)us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + None of us is going to be here forever. +

In response to

Responses

pgsql-bugs by date

Next:From: Robert HaasDate: 2010-06-10 13:48:02
Subject: Re: BUG #5488: pg_dump does not quote column names -> pg_restore may fail when upgrading
Previous:From: Bruce MomjianDate: 2010-06-10 13:45:43
Subject: Re: BUG #5488: pg_dump does not quote column names -> pg_restore may fail when upgrading

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group