expressions operating on arrays - Mailing list pgsql-sql

From h012@ied.com
Subject expressions operating on arrays
Date
Msg-id no.Yo.N.nN.0208090032250.2280-100000@business.com
Whole thread Raw
Responses Re: expressions operating on arrays  (Achilleus Mantzios <achill@matrix.gatewaynet.com>)
Re: expressions operating on arrays  (Oleg Bartunov <oleg@sai.msu.su>)
List pgsql-sql
Hi,
 I would like to say:

create table test1 (array1 int4[]);
insert into test1 values ('{123,234,345}');
insert into test1 values ('{456,567,678}');
now what I don't know how to do:

-- consider contents of array:
select * from test1 where array1 CONTAINS 567;

-- APPEND '789' to array in second row:
update test1 set array1=(select array1 from test1 where array1 CONTAINS 
'567' UNION select '789');

How do I go about expressing and operating on the contents of an array ?

   Thanks,
      John

-- 
-- Gospel of Jesus is the saving power of God for all who believe --              ## To some, nothing is impossible. ##
                  http://Honza.Vicherek.com/
 



pgsql-sql by date:

Previous
From: Ludwig Lim
Date:
Subject: Re: Table Sorting and Limit Question
Next
From: Achilleus Mantzios
Date:
Subject: Re: expressions operating on arrays