pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Pavel Golub <pavel@microolap.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
Cc: Josh Berkus <josh@agliodbs.com>
Cc: Bruce Momjian <bruce@momjian.us>
Cc: pgsql-bugs@postgresql.org
Cc: Pavel Golub <pavel@gf.microolap.com>
Subject: Re: Cannot dump 8.4.8 database using later versions
Date: Wed, 16 Nov 2011 09:12:54 +0200
Message-ID: <453659941.20111116091254@gf.microolap.com> (raw)
In-Reply-To: <9673.1321412697@sss.pgh.pa.us>
References: <201111142313.pAENDep01085@momjian.us>
	<4EC1B5BD.9010901@agliodbs.com>
	<4EC23BFE.4000302@enterprisedb.com>
	<CA+Tgmoa9hPiain-0LdL8OGifU6XiYJJgfS36c2-=B9Qo3GQVYA@mail.gmail.com>
	<9673.1321412697@sss.pgh.pa.us>

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




view thread (11+ messages)  latest in thread

Message-ID: <453659941.20111116091254@gf.microolap.com>
Permalink:  ../453659941.20111116091254@gf.microolap.com/
Also on:    postgresql.org/message-id/453659941.20111116091254@gf.microolap.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: pavel@microolap.com, tgl@sss.pgh.pa.us, robertmhaas@gmail.com, heikki.linnakangas@enterprisedb.com, josh@agliodbs.com, bruce@momjian.us, pavel@gf.microolap.com
  Subject: Re: Cannot dump 8.4.8 database using later versions
  In-Reply-To: <453659941.20111116091254@gf.microolap.com>
  References: <201111142313.pAENDep01085@momjian.us> <4EC1B5BD.9010901@agliodbs.com> <4EC23BFE.4000302@enterprisedb.com> <CA+Tgmoa9hPiain-0LdL8OGifU6XiYJJgfS36c2-=B9Qo3GQVYA@mail.gmail.com> <9673.1321412697@sss.pgh.pa.us> <453659941.20111116091254@gf.microolap.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox