Re: expressions operating on arrays

From: Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>
To: h012(at)ied(dot)com
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: expressions operating on arrays
Date: 2002-08-09 07:30:33
Message-ID: Pine.GSO.4.44.0208091030000.20678-100000@ra.sai.msu.su
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Look at contrib/intarray. You'll get an index access as a bonus

Oleg
On Fri, 9 Aug 2002 h012(at)ied(dot)com wrote:

>
>
> 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
>
>

Regards,
Oleg
_____________________________________________________________
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: oleg(at)sai(dot)msu(dot)su, http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2002-08-09 13:53:15 Re: expressions operating on arrays
Previous Message h012 2002-08-09 07:12:22 Re: expressions operating on arrays