Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 47E7BFB53D4 for ; Wed, 16 Nov 2011 03:52:41 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 11056-01-4 for ; Wed, 16 Nov 2011 07:52:35 +0000 (UTC) X-Greylist: delayed 00:38:52.591782 by SQLgrey-1.8.0-rc2 Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 63F871B53CF9 for ; Wed, 16 Nov 2011 03:52:09 -0400 (AST) Received: from mail-fx0-f46.google.com ([209.85.161.46]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RQZgF-000412-H7 for pgsql-bugs@postgresql.org; Wed, 16 Nov 2011 07:13:15 +0000 Received: by fagn18 with SMTP id n18so1127142fag.19 for ; Tue, 15 Nov 2011 23:12:58 -0800 (PST) Received: by 10.204.9.209 with SMTP id m17mr20691346bkm.101.1321427578185; Tue, 15 Nov 2011 23:12:58 -0800 (PST) Received: from [192.168.1.104] (227-27-113-92.pool.ukrtel.net. [92.113.27.227]) by mx.google.com with ESMTPS id l26sm19765030fad.17.2011.11.15.23.12.55 (version=SSLv3 cipher=OTHER); Tue, 15 Nov 2011 23:12:56 -0800 (PST) Date: Wed, 16 Nov 2011 09:12:54 +0200 From: Pavel Golub Reply-To: Pavel Golub Organization: Microolap X-Priority: 3 (Normal) Message-ID: <453659941.20111116091254@gf.microolap.com> To: Tom Lane CC: Robert Haas , Heikki Linnakangas , Josh Berkus , Bruce Momjian , , Pavel Golub Subject: Re: Cannot dump 8.4.8 database using later versions In-Reply-To: <9673.1321412697@sss.pgh.pa.us> References: <201111142313.pAENDep01085@momjian.us> <4EC1B5BD.9010901@agliodbs.com> <4EC23BFE.4000302@enterprisedb.com> <9673.1321412697@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=windows-1251 Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201111/111 X-Sequence-Number: 31706 Hello, Tom. You wrote: TL> Robert Haas writes: >> On Tue, Nov 15, 2011 at 5:16 AM, Heikki Linnakangas >> 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