Re: Cannot dump 8.4.8 database using later versions - Mailing list pgsql-bugs

From Tom Lane
Subject Re: Cannot dump 8.4.8 database using later versions
Date
Msg-id 9673.1321412697@sss.pgh.pa.us
Whole thread Raw
In response to Re: Cannot dump 8.4.8 database using later versions  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Cannot dump 8.4.8 database using later versions
Re: Cannot dump 8.4.8 database using later versions
Re: Cannot dump 8.4.8 database using later versions
List pgsql-bugs
Robert Haas <robertmhaas@gmail.com> writes:
> On Tue, Nov 15, 2011 at 5:16 AM, Heikki Linnakangas
> <heikki.linnakangas@enterprisedb.com> wrote:
>> NEW used to be a reserved keyword, but it's not so in 9.0 anymore. So 9.0
>> pg_dump thinks it doesn't need to be quoted.

> Why isn't it correct?

It's correct to not quote it in pg_dump's output (since we make no
promises that such output would load into a pre-9.0 server anyway).
The problem is that it needs to be quoted in commands that pg_dump
sends back to the 8.4 server.  Example:

psql (8.4.9)
You are now connected to database "db84".
db84=# create table "new"( f1 int, "new" text);

... pg_dump with newer pg_dump ...

pg_dump: SQL command failed
pg_dump: Error message from server: ERROR:  syntax error at or near "new"
LINE 1: COPY public.new (f1, new) TO stdout;
                             ^
pg_dump: The command was: COPY public.new (f1, new) TO stdout;

The least painful solution might be to always quote *every* identifier
in commands sent to the source server, since we don't especially care
how nice-looking those are.

            regards, tom lane

pgsql-bugs by date:

Previous
From: "CN Liu"
Date:
Subject: BUG #6294: character 0xefbd9e of encoding "UTF8" has no equivalent in "BIG5"
Next
From: Pavel Golub
Date:
Subject: Re: Cannot dump 8.4.8 database using later versions