Bug in Dependencies Code in 7.3.x?

Поиск
Список
Период
Сортировка
От Tara Piorkowski
Тема Bug in Dependencies Code in 7.3.x?
Дата
Msg-id 3E106FD3.8010000@vilaj.com
обсуждение исходный текст
Ответы Re: Bug in Dependencies Code in 7.3.x?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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
nulldefault 
 
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/>



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Dan Langille
Дата:
Сообщение: Re: why was libpq.so's version number bumped?
Следующее
От: Manfred Koizar
Дата:
Сообщение: Re: MOVE strangeness