bug# 2073 - Clarification

Поиск
Список
Период
Сортировка
От Dhanaraj M
Тема bug# 2073 - Clarification
Дата
Msg-id 444C8C1D.9020800@sun.com
обсуждение исходный текст
Ответы Re: bug# 2073 - Clarification  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Bug- raised:
=========
BUG #2073: Can't drop sequence when created via SERIAL column

Answered:
========

Right.  We have this TODO item:
* %Disallow changing default expression of a SERIAL column?

which would prevent you from changing the default expression for a
SERIAL column.  So the answer is, don't do that, and in the future, we
might prevent it.

Clarification required:
=================

Pl. look at the following code, which is taken from alter_table.sql 
(regression test)

=========================================================================

mydb=# create table anothertab (atcol1 serial8, atcol2 boolean, 
constraint anothertab_chk check (atcol1 <= 3));

NOTICE:  CREATE TABLE will create implicit sequence 
"anothertab_atcol1_seq" for serial column "anothertab.atcol1"

CREATE TABLE

mydb=# alter table anothertab alter column atcol1 drop default;
ALTER TABLE

mydb=# \d                List of relations
Schema |         Name          |   Type   |  Owner
--------+-----------------------+----------+----------
public | anothertab            | table    | dm199272
public | anothertab_atcol1_seq | sequence | dm199272

(2 rows)

mydb=# drop sequence anothertab_atcol1_seq;

ERROR:  cannot drop sequence anothertab_atcol1_seq because table 
anothertab column atcol1 requires it

HINT:  You may drop table anothertab column atcol1 instead.

=========================================================================

Please tell me whether statement-2 is valid or not (as you say that the 
default sequence should not be changed).

Or the default seq. can be dropped and cant be  changed. I like to know
the expected output.


Thanks

Dhanaraj





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

Предыдущее
От: "Qingqing Zhou"
Дата:
Сообщение: Re: Further reduction of bufmgr lock contention
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: TODO Item: ACL_CONNECT