Alter column / array - Mailing list pgsql-admin

From Rolf Lüttecke
Subject Alter column / array
Date
Msg-id 00f101c15224$0f952f20$8300a8c0@michaeltelecom.de
Whole thread Raw
Responses Re: Alter column / array
Re: Alter column / array
List pgsql-admin
Hi list,

I can't find out why the following command give different results:

database-# CREATE TABLE "test1" (dev_id int, dev_slots integer[] DEFAULT
'{0,0,0,0,0}');
CREATE

If you display (\d test1) the table-structure all looks good - even the
DEFAULTs.

...but if you have an existing table and want to add a column of type array,
it doesn't
work:

database-# CREATE TABLE "test2" (dev_id int);
CREATE
database-# ALTER TABLE "test2" ADD COLUMN dev_slots integer[] DEFAULT
'{0,0,0,0,0}');
ALTER

If you now display the table-structure, the DEFAULT-statement is not listed
and
UPDATE-commands on the ARRAY do strange things.

Any clou?

Regards
R. Lüttecke (IT)

MICHAELTELECOM AG
Bruchheide 34
49163 Bohmte
+49 5471 8060
http://www.michael-telecom.de


pgsql-admin by date:

Previous
From: Herbert Rabago Ambos
Date:
Subject: Re: Wanted: way to limit logging
Next
From: Dong B Calmada
Date:
Subject: how to create function/procedure for commenting multiple objects (e.g., columns)