Bug in Dependencies Code in 7.3.x?

From: Tara Piorkowski <tara(at)vilaj(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Bug in Dependencies Code in 7.3.x?
Date: 2002-12-30 16:09:55
Message-ID: 3E106FD3.8010000@vilaj.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I've found a situation that doesn't look correct to me in 7.3.1 (and
presumably 7.3 as well). If I alter a column so that it no longer uses a
sequence for default values and then try to drop the aforementioned
sequence, the dependency checking code does not allow me to drop the
sequence on the basis that it is still deing used. As I have removed the
default setting, however, this should not be the case, as far as I can
tell. The following illustrates my finding.

junk=> create table testing
junk-> (testing_id serial not null primary key);
NOTICE: CREATE TABLE will create implicit sequence
'testing_testing_id_seq' for SERIAL column 'testing.testing_id'
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index
'testing_pkey' for table 'testing'
CREATE TABLE
junk=> \d
List of relations
Schema | Name | Type | Owner
--------+------------------------+----------+--------
public | testing | table | tara
public | testing_testing_id_seq | sequence | tara
(2 rows)

junk=> \d testing
Table "public.testing"
Column | Type | Modifiers

------------+---------+-----------------------------------------------------------------
testing_id | integer | not null default
nextval('public.testing_testing_id_seq'::text)
Indexes: testing_pkey primary key btree (testing_id)

junk=> alter table testing
junk-> alter column testing_id drop default;
ALTER TABLE
junk=> \d testing
Table "public.testing"
Column | Type | Modifiers
------------+---------+-----------
testing_id | integer | not null
Indexes: testing_pkey primary key btree (testing_id)

junk=> drop sequence testing_testing_id_seq;
ERROR: Cannot drop sequence testing_testing_id_seq because table
testing column testing_id requires it
You may drop table testing column testing_id instead

--
Tara Piorkowski
System Administrator, vilaj.com, LLC
<http://www.vilaj.com/>

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Manfred Koizar 2002-12-30 18:50:52 Re: MOVE strangeness
Previous Message Dan Langille 2002-12-30 12:34:23 Re: why was libpq.so's version number bumped?