Tara Piorkowski <[EMAIL PROTECTED]> writes:
> junk=> create table testing
> junk-> (testing_id serial not null primary key);
> NOTICE:  CREATE TABLE will create implicit sequence 
> 'testing_testing_id_seq' for SERIAL column 'testing.testing_id'
> NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index 
> 'testing_pkey' for table 'testing'
> CREATE TABLE
> junk=> alter table testing
> junk-> alter column testing_id drop default;
> ALTER TABLE

I'd be inclined to say that the bug here is that you shouldn't be
allowed to do ALTER COLUMN DROP DEFAULT (nor SET DEFAULT for that
matter) on a SERIAL column.  The default expression is part of the
implementation of SERIAL, not an independently tweakable entity.

We could make it work sort of the way Tara is expecting if the
dependency link were to associate the sequence object with the
column's default expression, and not with the column itself ---
but if we did that, then the above DROP DEFAULT would probably make
the sequence object go away too, which is still not quite what
she's expecting.

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])

Reply via email to