bug with alter table add column

From: Jerome Alet <alet(at)unice(dot)fr>
To: pgsql-bugs(at)postgresql(dot)org
Subject: bug with alter table add column
Date: 2000-07-19 09:40:32
Message-ID: Pine.LNX.3.96.1000719111851.279A-100000@cortex.unice.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi,

Under Postgresql 7.0.2 (linux86), I've just noticed a strange behavior (I
suppose it's a bug) with alter table, but don't know if it's a known one
or not:

the following works great:

db=> CREATE TABLE foo (id SERIAL);
NOTICE: CREATE TABLE will create implicit sequence 'foo_id_seq' for
SERIAL column 'foo.id'
NOTICE: CREATE TABLE/UNIQUE will create implicit index 'foo_id_key' for
table 'foo'
CREATE

db=> \ds
List of relations
Name | Type | Owner
------------+----------+--------
foo_id_seq | sequence | jerome
(1 row)

but the following doesn't create the sequence bar_id_seq:

db=> CREATE TABLE bar (somefield TEXT);
CREATE
db=> ALTER TABLE bar ADD COLUMN id SERIAL;
ALTER
db=> \ds
List of relations
Name | Type | Owner
------------+----------+--------
foo_id_seq | sequence | jerome
(1 row)

The ALTER command should have created a sequence named bar_id_seq, as well
as an index but has done none.

I suppose it's a bug.

also it would be fine if ALTER could rename other things than just tables;

bye,

Jerome ALET - alet(at)unice(dot)fr - http://cortex.unice.fr/~jerome
Faculte de Medecine de Nice - http://noe.unice.fr - Tel: 04 93 37 76 30
28 Avenue de Valombrose - 06107 NICE Cedex 2 - FRANCE

Browse pgsql-bugs by date

  From Date Subject
Next Message Bernie Huang 2000-07-20 19:13:52 Damn bug!
Previous Message Tom Lane 2000-07-14 16:16:51 Re: Backend bug applying insert rules?