| From: | Fernando Schapachnik <fschapachnik(at)mecon(dot)gov(dot)ar> |
|---|---|
| To: | pgsql-general(at)postgresql(dot)org |
| Subject: | Is this a bug? (changing sequences in default value) |
| Date: | 2008-05-08 11:52:07 |
| Message-ID: | 20080508115207.GA1159@bal740r0.mecon.gov.ar |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
Pg 8.1.11, I try to change sequences as default value of a table, then
remove old sequence:
# \d table1
Table "table1"
Column | Type | Modifiers
--------+---------+---------------------------------------------------------------
id | integer | not null default nextval('table1_id_seq'::regclass)
nombre | text | not null
Indexes:
"table1_pkey" PRIMARY KEY, btree (id)
# ALTER TABLE table1 alter column id set default nextval('newseq_id_seq');
ALTER TABLE
# \d table1
Table "table1"
Column | Type | Modifiers
--------+---------+---------------------------------------------------------------
id | integer | not null default nextval('newseq_id_seq'::regclass)
nombre | text | not null
Indexes:
"table1_pkey" PRIMARY KEY, btree (id)
# drop SEQUENCE table1_id_seq ;
ERROR: cannot drop sequence table1_id_seq because table
table1 column id requires it
HINT: You may drop table table1 column id instead.
Am I doing something wrong?
Thanks!
Fernando.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Dimitri Fontaine | 2008-05-08 11:59:14 | Re: Import German Decimal Numbers |
| Previous Message | Richard Huxton | 2008-05-08 10:24:43 | Re: Problems with memory |