array surprising behavior - Mailing list pgsql-hackers

From Alvaro Herrera
Subject array surprising behavior
Date
Msg-id 20040204120838.GA10446@dcc.uchile.cl
Whole thread Raw
Responses Re: array surprising behavior  (Joe Conway <mail@joeconway.com>)
List pgsql-hackers
Hi,

I think this is most surprising behavior -- shouldn't the UPDATE raise
an error?

alvherre=# create table foo (a int[]);
CREATE TABLE
alvherre=# insert into foo values (null);
INSERT 33649 1
alvherre=# update foo set a[3] = '42';
UPDATE 1
alvherre=# select a, a is null from foo;a | ?column?
---+----------  | t
(1 fila)
alvherre=# select version();                                                 version
-----------------------------------------------------------------------------------------------------------PostgreSQL
7.5develon i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.3.1 (Mandrake Linux 9.2 3.3.1-2mdk)
 
(1 fila)


(This is CVS tip as of a couple weeks ago)

-- 
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"El destino baraja y nosotros jugamos" (A. Schopenhauer)


pgsql-hackers by date:

Previous
From: Andrew Rawnsley
Date:
Subject: Re: Recursive queries?
Next
From: Christopher Browne
Date:
Subject: Re: Recursive queries?