Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 1DAE8EF9AA for ; Tue, 15 Nov 2011 06:26:29 -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 15743-03 for ; Tue, 15 Nov 2011 10:26:22 +0000 (UTC) X-Greylist: delayed 00:09:33.224675 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 A6F89EF9A9 for ; Tue, 15 Nov 2011 06:26:22 -0400 (AST) Received: from exprod7og125.obsmtp.com ([64.18.2.28]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RQG4O-0006R2-K7 for pgsql-bugs@postgresql.org; Tue, 15 Nov 2011 10:16:49 +0000 Received: from mail-bw0-f50.google.com ([209.85.214.50]) (using TLSv1) by exprod7ob125.postini.com ([64.18.6.12]) with SMTP ID DSNKTsI8A2Sm4+Ha+IHi2PPVfw2bB4TMlhCn@postini.com; Tue, 15 Nov 2011 02:16:48 PST Received: by bkbzu17 with SMTP id zu17so996701bkb.23 for ; Tue, 15 Nov 2011 02:16:33 -0800 (PST) Received: by 10.205.119.207 with SMTP id fv15mr23546794bkc.100.1321352193419; Tue, 15 Nov 2011 02:16:33 -0800 (PST) Received: from [192.168.1.100] (dsl-hkibrasgw2-ff6cc300-200.dhcp.inet.fi. [88.195.108.200]) by mx.google.com with ESMTPS id y10sm16826537fal.10.2011.11.15.02.16.31 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 15 Nov 2011 02:16:32 -0800 (PST) Message-ID: <4EC23BFE.4000302@enterprisedb.com> Date: Tue, 15 Nov 2011 12:16:30 +0200 From: Heikki Linnakangas User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; fi-FI; rv:1.9.2.23) Gecko/20111010 Icedove/3.1.15 MIME-Version: 1.0 To: Josh Berkus CC: Bruce Momjian , pgsql-bugs@postgresql.org Subject: Re: Cannot dump 8.4.8 database using later versions References: <201111142313.pAENDep01085@momjian.us> <4EC1B5BD.9010901@agliodbs.com> In-Reply-To: <4EC1B5BD.9010901@agliodbs.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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/105 X-Sequence-Number: 31700 On 15.11.2011 02:43, Josh Berkus wrote: > >>> ... somehow the query to dump the sequences is getting mangled. Any >>> clue how? >> >> Seems you have a sequence called "new"; seems we don't handle that >> well. > > So, tested this some more. For some reason, 8.4's pg_dump would > recognize NEW as a reserved word and quote it before dumping. 9.0 and > later pg_dump does not. Any ideas? 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. This is a problem with any keyword that was reserved (or col_name_keyword or type_func_name_keyword) in an earlier release, but has since been made unreserved. Looking at the history of our keyword lists, that has happened to four keywords: OFF (was reserved <= 8.4) NEW (was reserved <= 8.4) OLD (was reserved <= 8.4) PUBLIC (was func_name_keyword <= 7.2) There's also CONVERT, which used to be a col_name_keyword in versions <= 8.2, but that doesn't seem to cause trouble with pg_dump. I'm thinking that we should add a list of these used-to-be keywords somewhere in pg_dump (like in keywords.c), and check that list in addition to the regular keyword list in fmtId(). -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com