postgresql drop table

Posted by Russell on Stack Overflow See other posts from Stack Overflow or by Russell
Published on 2011-11-28T16:55:09Z Indexed on 2011/11/28 17:54 UTC
Read the original article Hit count: 257

Filed under:

I have two tables (tbl and tbl_new) that both use the same sequence (tbl_id_seq). I'd like to drop one of those tables. On tbl, I've removed the modifier "not null default nextval('tbl_id_seq'::regclass)" but that modifier remains on tbl_new. I'm getting the following error:

ERROR: cannot drop table tbl because other objects depend on it DETAIL: default for table tbl_new column id depends on sequence tbl_id_seq

After reviewing http://www.postgresql.org/docs/9.1/static/sql-droptable.html It looks like there is only CASCADE and RESTRICT as options.

© Stack Overflow or respective owner

Related posts about postgresql