Re: pg_dump SERIAL and SEQUENCE

From: Erik Jones <erik(at)myemma(dot)com>
To: Andreas Kretschmer <akretschmer(at)spamfence(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: pg_dump SERIAL and SEQUENCE
Date: 2007-10-18 20:29:25
Message-ID: E1994A11-1552-42F9-87CA-805654C95455@myemma.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Oct 18, 2007, at 1:02 PM, Andreas Kretschmer wrote:

> Laurent ROCHE <laurent_roche(at)yahoo(dot)com> schrieb:
>> 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 ! ! !
>
> Read this message: <28684(dot)1192378480(at)sss(dot)pgh(dot)pa(dot)us>
>
> ,----[ quote Tom Lane ]
> | In 8.2 and up you can use ALTER SEQUENCE ... OWNED BY ... to
> establish
> `----
>
> You see the difference?
>
>
> Regards, Andreas

Andreas's point is that the OWNED BY clause was added in 8.2 to fix
your issue and it is policy to not change functionality of older
releases unless it is to fix an actual, proven error. Basically, if
your sequence isn't owned by any particular table then it is
considered an independent relation and you need to manage it's being
dump/restored on its own just like with any other independent relation.

Erik Jones

Software Developer | Emma®
erik(at)myemma(dot)com
800.595.4401 or 615.292.5888
615.292.0777 (fax)

Emma helps organizations everywhere communicate & market in style.
Visit us online at http://www.myemma.com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bob Pawley 2007-10-18 20:33:27 Fetch
Previous Message Alan Hodgson 2007-10-18 20:19:32 Re: relations does not exist