Re: Copying data from int column to array column

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Adam Witney <awitney(at)sgul(dot)ac(dot)uk>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Copying data from int column to array column
Date: 2005-06-08 16:34:14
Message-ID: 4099.1118248454@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Adam Witney <awitney(at)sgul(dot)ac(dot)uk> writes:
> UPDATE test SET field2 = field1;
> UPDATE test SET field3[1] = field1;

> Why does the UPDATE of field2 work, but the UPDATE of field3 does not?

Works for me in 8.0 ;-). Before 8.0, if you tried to assign to just one
value of an array that was initially NULL, the array stayed NULL.

(That behavior made sense from the point of view of the implementation,
which sees array element assignment as a binary operation taking an
array and a new element value ... but it wasn't especially useful.)

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message dong changyu 2005-06-08 17:00:10 Re: vulnerability/SSL
Previous Message Stephan Szabo 2005-06-08 16:16:40 Re: Foreign keys and slow insert