Re: [GENERAL] Sequences/defaults and pg_dump - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [GENERAL] Sequences/defaults and pg_dump
Date
Msg-id 4412.1139516639@sss.pgh.pa.us
Whole thread Raw
In response to Re: [GENERAL] Sequences/defaults and pg_dump  (Alvaro Herrera <alvherre@commandprompt.com>)
List pgsql-hackers
Alvaro Herrera <alvherre@commandprompt.com> writes:
> Tom Lane wrote:
>> The only thing we'd lose is that dropping a column
>> originally declared as serial wouldn't implicitly drop the sequence.

> Wasn't that the primary purpose that the main coder for dependencies did
> the work for?

My recollection is that the dependency for serials was added as an
afterthought without too much consideration of the long-term
implications.  It was a cheap way of sort-of solving an immediate
problem using a mechanism that we were putting in place anyway.
But what we've got now is a misbegotten cross between the theory that
a SERIAL is a unitary object you mustn't muck with the innards of,
and the theory that SERIAL is just a macro that sets up an initial
state you can ALTER to your heart's content later.

IMHO we should make a choice between those plans and stick to it,
not add more and more infrastructure to let you ALTER things you
shouldn't be altering.  Either a SERIAL is a black box or it isn't.
If it is not to be a black box, we need to reduce rather than increase
the amount of hidden semantics.
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Mark Woodward"
Date:
Subject: Re: PostgreSQL 8.0.6 crash
Next
From: Martijn van Oosterhout
Date:
Subject: Re: Server Programming in C: palloc() and pfree()