Re: alter table serial->int

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Erik Aronesty" <erik@xxxxxxx> writes:
> alter table x alter a set default 999;

> still doesn't help.

Doesn't help what?

If you mean that the sequence object is still there, you can drop that too.

regression=# create table x(a serial not null);
NOTICE:  CREATE TABLE will create implicit sequence "x_a_seq" for serial column "x.a"
CREATE TABLE
regression=# drop sequence x_a_seq;
NOTICE:  default for table x column a depends on sequence x_a_seq
ERROR:  cannot drop sequence x_a_seq because other objects depend on it
HINT:  Use DROP ... CASCADE to drop the dependent objects too.
regression=# alter table x alter a set default 999;
ALTER TABLE
regression=# drop sequence x_a_seq;
DROP SEQUENCE
regression=# \d x
            Table "public.x"
 Column |  Type   |      Modifiers       
--------+---------+----------------------
 a      | integer | not null default 999


			regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

               http://archives.postgresql.org

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux