Re: Alter column / array
От | Stephan Szabo |
---|---|
Тема | Re: Alter column / array |
Дата | |
Msg-id | Pine.BSF.4.21.0110111105060.92439-100000@megazone23.bigpanda.com обсуждение исходный текст |
Ответ на | Alter column / array (Rolf Lüttecke <rolf.luettecke@michael-telecom.de>) |
Список | pgsql-admin |
On Thu, 11 Oct 2001, [iso-8859-1] Rolf L�ttecke wrote: > 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. If I remember correctly, defaults are currently ignored on add column. I think you can use alter table alter column to add the default. And, what do you mean by updates doing strange things?
В списке pgsql-admin по дате отправления: