Search Postgresql Archives

Re: Dereferencing a 2-dimensional array in plpgsql

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Sven Willenberger <sven@xxxxxxx> writes:
> Tom Lane wrote:
>> I think we changed this in 8.0.  Before 8.0, trying to assign to an
>> element of a NULL array yielded a NULL result array, but I think now
>> we let you produce a one-element array that way.
>> 
> Using a 8.0 testbox I find that the arrays still need to be initialized:

[ looks at code... ]  Hmm, we changed the main executor but missed plpgsql.
I think this is a bug, since plpgsql is now inconsistent with what
happens in a SQL UPDATE command:

regression=# create table foo (f1 int[]);
CREATE TABLE
regression=# insert into foo values(null);
INSERT 155342 1
regression=# update foo set f1[1] = 33;
UPDATE 1
regression=# select * from foo;
  f1
------
 {33}
(1 row)

regression=#

I'll see about making plpgsql behave similarly for 8.0.2.

			regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@xxxxxxxxxxxxxx

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux