Re: Cannot dump 8.4.8 database using later versions

Поиск
Список
Период
Сортировка
От Pavel Golub
Тема Re: Cannot dump 8.4.8 database using later versions
Дата
Msg-id 453659941.20111116091254@gf.microolap.com
обсуждение исходный текст
Ответ на Re: Cannot dump 8.4.8 database using later versions  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
Hello, Tom.

You wrote:

TL> 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?

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

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

TL> ... pg_dump with newer pg_dump ...

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

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

+1 for this. This will prevent such situations in the future.

TL>                         regards, tom lane




--
With best wishes,
 Pavel                          mailto:pavel@gf.microolap.com

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Cannot dump 8.4.8 database using later versions
Следующее
От: "CN"
Дата:
Сообщение: Re: BUG #6294: character 0xefbd9e of encoding "UTF8" has no equivalent in "BIG5"