pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rolf Lüttecke <rolf.luettecke@michael-telecom.de>
To: pgsql-admin@postgresql.org
Subject: Alter column / array
Date: Thu, 11 Oct 2001 09:12:17 +0200
Message-ID: <00f101c15224$0f952f20$8300a8c0@michaeltelecom.de> (raw)

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




view thread (5+ messages)  latest in thread

Message-ID: <00f101c15224$0f952f20$8300a8c0@michaeltelecom.de>
Permalink:  ../00f101c15224$0f952f20$8300a8c0@michaeltelecom.de/
Also on:    postgresql.org/message-id/00f101c15224$0f952f20$8300a8c0@michaeltelecom.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: rolf.luettecke@michael-telecom.de
  Subject: Re: Alter column / array
  In-Reply-To: <00f101c15224$0f952f20$8300a8c0@michaeltelecom.de>
  References: <00f101c15224$0f952f20$8300a8c0@michaeltelecom.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox