Re: pg_dump writes SEQUENCEs twice with -a

From: "Oliver Elphick" <olly(at)lfix(dot)co(dot)uk>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_dump writes SEQUENCEs twice with -a
Date: 2001-03-07 20:48:32
Message-ID: 200103072048.f27KmWG26066@linda.lfix.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

kovacsz wrote:
>I reported this problem about 3 weeks ago or even more. The problem hasn't
>disappeared yet. In 7.1beta4 if 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(at)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(at)linda$

--
Oliver Elphick Oliver(dot)Elphick(at)lfix(dot)co(dot)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 the Father, and of the Son, and of the
Holy Ghost; Teaching them to observe all things
whatsoever I have commanded you; and, lo, I am with
you alway, even unto the end of the world. Amen."
Matthew 28:19,20

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mikheev, Vadim 2001-03-07 21:04:20 RE: Proposed WAL changes
Previous Message Mikheev, Vadim 2001-03-07 20:03:41 RE: Proposed WAL changes