Dropping sequences

Started by Robert Fitzpatrickover 21 years ago2 messagesgeneral
Jump to latest
#1Robert Fitzpatrick
robert@webtent.com

I have changed the default sequence on a primary key integer (created as
SERIAL) field in a table, but it will not let me drop the old sequence
and continues to tell me that the sequence is required by the table. Can
someone tell me what is required to get this dropped? I am just paranoid
that it could be using the old sequence still even though it seems all
is coming from the new sequence.

--
Robert

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Robert Fitzpatrick (#1)
Re: Dropping sequences

Robert Fitzpatrick <robert@webtent.com> writes:

I have changed the default sequence on a primary key integer (created as
SERIAL) field in a table, but it will not let me drop the old sequence
and continues to tell me that the sequence is required by the table. Can
someone tell me what is required to get this dropped?

Theoretically you have to drop the serial column.

If you don't mind mucking with system catalogs, you could remove the
pg_depend entry linking the sequence to the column, and then it would
let you drop the sequence.

regards, tom lane