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

From Tom Lane
Subject Re: pg_dump versus SERIAL, round N
Date
Msg-id 27407.1156087869@sss.pgh.pa.us
Whole thread Raw
In response to Re: pg_dump versus SERIAL, round N  ("Andrew Dunstan" <andrew@dunslane.net>)
List pgsql-hackers
"Andrew Dunstan" <andrew@dunslane.net> writes:
> 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 :-(

Well, we're not in a green field anymore :-(.  In any case there would
be some serious practical disadvantages in trying to hide the underlying
sequence fully:

* you couldn't use ALTER SEQUENCE, eg to adjust the sequence's CYCLE
property, which seems like a useful thing to do;

* permissions management would get interesting too;

* how's pg_dump going to access the sequence to restore its correct
count value etc?

I think we'd end up building a lot of facilities parallel to those that
exist for "ordinary" sequences, and then this doesn't seem like such a
clean solution anymore...
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: pg_dump versus SERIAL, round N
Next
From: Michael Meskes
Date:
Subject: Re: Coverity reports looking good