Tuesday, May 13, 2008

Re: [GENERAL] Is this a bug? (changing sequences in default value)

En un mensaje anterior, Merlin Moncure escribió:
[...]
> >> > Am I doing something wrong?
> >>
> >> yes and no when you created the table initially you probably made it
> >> a 'serial' column which set up the ownership that prevents the drop
> >> operation. that ownership did not go away when you altered the
> >> default to the new serial.
> >>
> >> to fix this,
> >> alter sequence sequence table1_id_seq owned by none; -- now you can drop
> >
> > Hi, Merlin. Thanks for the tip, but it doesn't work. Every variation
> > of this syntax I tried gives me error as, apparently, it should:
> >
> > \h ALTER SEQUENCE
> > Command: ALTER SEQUENCE
> > Description: change the definition of a sequence generator
> > Syntax:
> > ALTER SEQUENCE name [ INCREMENT [ BY ] increment ]
> > [ MINVALUE minvalue | NO MINVALUE ] [ MAXVALUE maxvalue | NO
> > MAXVALUE ]
> > [ RESTART [ WITH ] start ] [ CACHE cache ] [ [ NO ] CYCLE ]
>
> oop, you are using 8.1 :-). This was added in a later version. drop
> sequence ... cascade should probably work. you can try it out in a
> transaction to be sure.

Thanks for your help, but cascade doesn't make a difference.

Fernando.

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

No comments: