Re: pg_dump versus SERIAL, round N - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: pg_dump versus SERIAL, round N
Date
Msg-id 3819.24.211.165.134.1156080423.squirrel@www.dunslane.net
Whole thread Raw
In response to Re: pg_dump versus SERIAL, round N  (Andreas Pflug <pgadmin@pse-consulting.de>)
Responses Re: pg_dump versus SERIAL, round N
List pgsql-hackers
Andreas Pflug wrote:
> Tom Lane wrote:
>>
>> Almost everything I just said is already how it works today; the
>> difference is that today you do not have the option to drop t1 without
>> dropping the sequence, because there's no (non-hack) way to remove the
>> dependency.
>>
> As far as I understand your proposal I like it, but I'd like to insure
> that the situation where a sequence is used by multiple tables is
> handled correctly. There _are_ databases that reuse a sequence for
> multiple serial-like columns, and pgadmin supports this (including a
> pg_depend insert, which would need a version dependent fix).
>


If we were implementing serial from scratch, I would be arguing that the
underlying sequence should be merely an implementation detail that should
be totally hidden, and sequences used explicitly should be kept as a
separate concept. Then many of these problems simply wouldn't exist. I
realise that might be difficult to get to now :-(

cheers

andrew



pgsql-hackers by date:

Previous
From: Andreas Pflug
Date:
Subject: Re: pg_dump versus SERIAL, round N
Next
From: Martijn van Oosterhout
Date:
Subject: Coverity reports looking good