On 2/7/06, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Nikolay Samokhvalov <samokhvalov@gmail.com> writes:
> > testseq=# CREATE TABLE test(id SERIAL, data TEXT);
> > NOTICE: CREATE TABLE will create implicit sequence "test_id_seq" for
> > serial column "test.id"
> > CREATE TABLE
> > ***
> > ALTER TABLE test ALTER COLUMN id SET DEFAULT nextval('test_id_seq') * 10;
>
> The correct solution to this is to forbid ALTER COLUMN SET DEFAULT on
> a serial column, but we haven't gotten around to enforcing that yet.
That's wrong!
Forget about SERIAL. I have INTEGER column with some expression as
DEFAULT in it. I use sequence in that expression and want this to be
dumped correctly.
The bug doesn't concerns SERIALs, in concerns general usage of sequences.
>
> regards, tom lane
>
--
Best regards,
Nikolay