Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id E901EA684DE; Mon, 21 May 2012 16:00:07 -0300 (ADT) Received: from relay3-d.mail.gandi.net ([217.70.183.195]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SWXpp-0005QP-9t; Mon, 21 May 2012 19:00:06 +0000 X-Originating-IP: 217.70.178.144 Received: from mfilter16-d.gandi.net (mfilter16-d.gandi.net [217.70.178.144]) by relay3-d.mail.gandi.net (Postfix) with ESMTP id 35ED8A8101; Mon, 21 May 2012 20:59:38 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mfilter16-d.gandi.net Received: from relay3-d.mail.gandi.net ([217.70.183.195]) by mfilter16-d.gandi.net (mfilter16-d.gandi.net [10.0.15.180]) (amavisd-new, port 10024) with ESMTP id FHvcrfkrQoVY; Mon, 21 May 2012 20:59:36 +0200 (CEST) X-Originating-IP: 98.27.54.176 Received: from [192.168.10.146] (cpe-098-027-054-176.nc.res.rr.com [98.27.54.176]) (Authenticated sender: adsend@dunslane.net) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 91373A80AE; Mon, 21 May 2012 20:59:35 +0200 (CEST) Message-ID: <4FBA9096.30107@dunslane.net> Date: Mon, 21 May 2012 14:59:34 -0400 From: Andrew Dunstan User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120329 Thunderbird/11.0.1 MIME-Version: 1.0 To: Tom Lane CC: Martin Pitt , PostgreSQL Bugs , PostgreSQL-development Subject: Re: 9.2beta1 regression: pg_restore --data-only does not set sequence values any more References: <20120515122500.GD3041@piware.de> <23209.1337173706@sss.pgh.pa.us> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201205/123 X-Sequence-Number: 33094 On 05/16/2012 10:23 AM, Andrew Dunstan wrote: > > > On Wed, May 16, 2012 at 9:08 AM, Tom Lane > wrote: > > Martin Pitt > writes: > > while packaging 9.2 beta 1 for Debian/Ubuntu the postgresql-common > > test suite noticed a regression: It seems that pg_restore > --data-only > > now skips the current value of sequences, so that in the upgraded > > database the sequence counter is back to the default. > > I believe this is a consequence of commit > a4cd6abcc901c1a8009c62a27f78696717bb8fe1, which introduced the > entirely > false assumption that --schema-only and --data-only have something to > do with the order that entries appear in the archive ... > > > > Darn, will investigate. > > [cc -hackers] Well, the trouble is that we have these pesky SECTION_NONE entries for things like comments, security labels and ACLs that need to be dumped in the right section, so we can't totally ignore the order. But we could (and probably should) ignore the order for making decisions about everything BUT those entries. So, here's a revised plan: --section=data will dump exactly TABLE DATA, SEQUENCE SET or BLOBS entries --section=pre-data will dump SECTION_PRE_DATA items (other than SEQUENCE SET) plus any immediately following SECTION_NONE items. --section=post-data will dump everything else. Comments? cheers andrew