Re: pg_dump versus SERIAL, round N

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Andrew Dunstan" <andrew(at)dunslane(dot)net>
Cc: "Andreas Pflug" <pgadmin(at)pse-consulting(dot)de>, "Bruce Momjian" <bruce(at)momjian(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_dump versus SERIAL, round N
Date: 2006-08-20 15:31:09
Message-ID: 27407.1156087869@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Andrew Dunstan" <andrew(at)dunslane(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Meskes 2006-08-20 15:48:11 Re: Coverity reports looking good
Previous Message Tom Lane 2006-08-20 15:10:55 Re: pg_dump versus SERIAL, round N