Re: arrays broken in 7.1.3? also, support for embedded tables present? - Mailing list pgsql-bugs

From Tom Lane
Subject Re: arrays broken in 7.1.3? also, support for embedded tables present?
Date
Msg-id 18619.1010642592@sss.pgh.pa.us
Whole thread Raw
In response to arrays broken in 7.1.3? also, support for embedded tables present?  ("Robby Dermody" <robbyd@robbyd.org>)
List pgsql-bugs
"Robby Dermody" <robbyd@robbyd.org> writes:
> allshotup=# CREATE TABLE foo (bla0 text, bla1 varchar(20)[], bla2
> char(20)[], bla3 text[]);
> CREATE

> allshotup=# INSERT INTO foo (bla0) VALUES ('test');
> INSERT 19408 1

> allshotup=# UPDATE foo SET bla1[1] = 'bla1', bla2[1] = 'bla2', bla3[1] =
> 'bla3' WHERE bla0='test';
> UPDATE 1

> allshotup=# SELECT * FROM foo;
>  bla0 | bla1 | bla2 | bla3
> ------+------+------+------
>  test |      |      |
> (1 row)

Right at the moment I don't believe there's any support for assigning
into one element of an array that's NULL; the array just stays NULL.
This could doubtless be improved, but no one's really stepped up to
work on the array code in a long time.  It's got lotsa shortcomings
besides this one :-(

If you feel motivated to work on this, start by looking at
ExecEvalArrayRef() in execQual.c.  You'd need to hack both it and
the arrayfuncs.c routines it calls in order to be smarter about
initially-NULL array values.

            regards, tom lane

pgsql-bugs by date:

Previous
From: "Robby Dermody"
Date:
Subject: arrays broken in 7.1.3? also, support for embedded tables present?
Next
From: pgsql-bugs@postgresql.org
Date:
Subject: Bug #559: MACADDR type & 00:00:00:00:00:00