Re: pg_dump writes SEQUENCEs twice with -a - Mailing list pgsql-hackers

From Oliver Elphick
Subject Re: pg_dump writes SEQUENCEs twice with -a
Date
Msg-id 200103072048.f27KmWG26066@linda.lfix.co.uk
Whole thread Raw
In response to pg_dump writes SEQUENCEs twice with -a  (kovacsz <zoli@pc10.radnoti-szeged.sulinet.hu>)
Responses Re: pg_dump writes SEQUENCEs twice with -a
List pgsql-hackers
kovacsz wrote: >I reported this problem about 3 weeks ago or even more. The problem hasn't >disappeared yet. In
7.1beta4if I use pg_dump with -a switch together, I >get each CREATE SEQUENCE twice. I suspected if this is an
installation>problem at my place but now I think it maybe isn't. > >You answered that noone experienced anything like
this.Here I get this >behaviour with the most simple table as well.
 

I get the same error using 7.1beta4.  See this example for a 1 table database:

olly@linda$ pg_dump -a junk
--
-- Selected TOC Entries:
--
\connect - olly
--
-- TOC Entry ID 1 (OID 2091620)
--
-- Name: "basket_id_seq" Type: SEQUENCE Owner: olly
--

CREATE SEQUENCE "basket_id_seq" start 1 increment 1 maxvalue 2147483647 
minvalue 1  cache 1 ;

--
-- TOC Entry ID 3 (OID 2091620)
--
-- Name: "basket_id_seq" Type: SEQUENCE Owner: olly
--

CREATE SEQUENCE "basket_id_seq" start 1 increment 1 maxvalue 2147483647 
minvalue 1  cache 1 ;

--
-- Data for TOC Entry ID 5 (OID 2091639) TABLE DATA basket
--

-- Disable triggers
UPDATE "pg_class" SET "reltriggers" = 0 WHERE "relname" ~* 'basket';
COPY "basket"  FROM stdin;
1    2001-03-04 19:59:58+00
\.
-- Enable triggers
BEGIN TRANSACTION;
CREATE TEMP TABLE "tr" ("tmp_relname" name, "tmp_reltriggers" smallint);
INSERT INTO "tr" SELECT C."relname", count(T."oid") FROM "pg_class" C, 
"pg_trigger" T WHERE C."oid" = T."tgrelid" AND C."relname" ~* 'basket'  GROUP 
BY 1;
UPDATE "pg_class" SET "reltriggers" = TMP."tmp_reltriggers" FROM "tr" TMP 
WHERE "pg_class"."relname" = TMP."tmp_relname";
DROP TABLE "tr";
COMMIT TRANSACTION;

--
-- TOC Entry ID 2 (OID 2091620)
--
-- Name: "basket_id_seq" Type: SEQUENCE SET Owner: 
--

SELECT setval ('"basket_id_seq"', 1, 't');

--
-- TOC Entry ID 4 (OID 2091620)
--
-- Name: "basket_id_seq" Type: SEQUENCE SET Owner: 
--

SELECT setval ('"basket_id_seq"', 1, 't');

olly@linda$ 

-- 
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight                              http://www.lfix.co.uk/oliver
PGP: 1024R/32B8FAA1: 97 EA 1D 47 72 3F 28 47  6B 7E 39 CC 56 E4 C1 47
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
========================================   "Go ye therefore, and teach all nations, baptizing them     in the name of
theFather, and of the Son, and of the      Holy Ghost; Teaching them to observe all things       whatsoever I have
commandedyou; and, lo, I am with      you alway, even unto the end of the world. Amen."                         Matthew
28:19,20
 




pgsql-hackers by date:

Previous
From: "Mikheev, Vadim"
Date:
Subject: RE: Proposed WAL changes
Next
From: "Mikheev, Vadim"
Date:
Subject: RE: Proposed WAL changes