From: | Laurent ROCHE <laurent_roche(at)yahoo(dot)com> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | pg_dump SERIAL and SEQUENCE |
Date: | 2007-10-18 17:38:39 |
Message-ID: | 273942.54465.qm@web34407.mail.mud.yahoo.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Hi,
I have a problem with pg_dump generating a code with no SERIALs id but with SEQUENCEs instead: if I write in a SERIAL I want to see a SERIAL, even when I reload the database.
We had this conversation before on this mailing list and I was told that's because SERIAL is just a kind of macro generating the same thing as the equivalent code translated using SEQUENCE.
This is not true however, if I create tab_a like this:
CREATE TABLE tab_a (
cola1 SERIAL
);and tab_b like this (whic is what pg_dump will do)
CREATE SEQUENCE tab_b_colb1_seq;
CREATE TABLE tab_b(
colb1 integer DEFAULT nextval('tab_b_colb1_seq') NOT NULL
);
Then when I drop tab_b, the SEQUENCE tab_b_colb1_seq
is not dropped, however when I drop tab_a, the SEQUENCE tab_a_cola1_seq is dropped too !
I am using PG 8.1 and ALTER SEQUENCE ... OWNED BY does not exist ! ! !
Cheers,
L(at)u
The Computing Froggy
_____________________________________________________________________________
Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail
From | Date | Subject | |
---|---|---|---|
Next Message | Laurent ROCHE | 2007-10-18 17:41:57 | Re : Am I overseen ? |
Previous Message | Filip Rembiałkowski | 2007-10-18 17:33:50 | Re: Resetting SEQUENCEs |