Bug in sequence dependency checking

From: Ruslan A Dautkhanov <rusland(at)scn(dot)ru>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Bug in sequence dependency checking
Date: 2003-05-20 03:49:14
Message-ID: 3EC9A5BA.87BF34D1@scn.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hello all,

PostgreSQL do not remove it's internal dependency when I DROP DEFAULT (it was nextval(...)),
so I still can't remove the sequence. Please see the real example bellow:

isbs=# \d ttPrefixes
Table "public.ttprefixes"
Column | Type | Modifiers
--------+---------+---------------------------------------------------------------
ttpid | integer | not null default nextval('public.ttprefixes_ttpid_seq'::text)
ttid | integer | not null default nextval('public.ttprefixes_ttid_seq'::text)
prefix | text |
descr | text |
dton | date |
dtoff | date |
Indexes: ttprefixes_pkey primary key btree (ttpid)
Foreign Key constraints: $1 FOREIGN KEY (ttid) REFERENCES teltypes(ttid) ON UPDATE NO ACTION ON DELETE
CASCADE

isbs=# alter table ttPrefixes alter ttid DROP DEFAULT;
ALTER TABLE

isbs=# \d ttPrefixes
Table "public.ttprefixes"
Column | Type | Modifiers
--------+---------+---------------------------------------------------------------
ttpid | integer | not null default nextval('public.ttprefixes_ttpid_seq'::text)
ttid | integer | not null
prefix | text |
descr | text |
dton | date |
dtoff | date |
Indexes: ttprefixes_pkey primary key btree (ttpid)
Foreign Key constraints: $1 FOREIGN KEY (ttid) REFERENCES teltypes(ttid) ON UPDATE NO ACTION ON DELETE
CASCADE

isbs=# DROP sequence public.ttprefixes_ttpid_seq;
ERROR: Cannot drop sequence ttprefixes_ttpid_seq because table ttprefixes column ttpid requires it
You may drop table ttprefixes column ttpid instead

isbs=# select version();
version
---------------------------------------------------------------------
PostgreSQL 7.3.2 on i386-unknown-freebsd4.7, compiled by GCC 2.95.4
(1 row)

See last DROP command - it's not executed, but the ttprefixes table don't really "require" the sequence -
I had dropped the DEFAULT! Is it possible to force deletion of such sequences ? Thanks for advance.

--
best regards,
Ruslan A Dautkhanov rusland(at)scn(dot)ru

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2003-05-20 14:55:15 Re: Bug in sequence dependency checking
Previous Message Jari Aalto 2003-05-18 00:40:03 Suggestion: pg_hba.conf - improve postgresql-7.3.2/html/client-authentication.html