pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Achilleus Mantzios <achill@matrix.gatewaynet.com>
To: Michael Weaver <mweaver@corpusglobe.com>
Cc: 'Stephan Szabo' <sszabo@megazone23.bigpanda.com>
Cc: 'pgsql-novice@postgresql.org' <pgsql-novice@postgresql.org>
Cc: 'pgsql-sql@postgresql.org' <pgsql-sql@postgresql.org>
Subject: Re: [SQL] Passing arrays
Date: Fri, 14 Feb 2003 10:10:09 -0200 (GMT+2)
Message-ID: <Pine.LNX.4.44.0302141007300.16950-100000@matrix.gatewaynet.com> (raw)
In-Reply-To: <3B663B41B350D311AEEF00A0C9254563201A72@VISION1>

On Fri, 14 Feb 2003, Michael Weaver wrote:

>
>
> > -----Original Message-----
> > From: Stephan Szabo [mailto:sszabo@megazone23.bigpanda.com]
> > Sent: Friday, 14 February 2003 12:58 PM
> > To: Michael Weaver
> > Cc: 'pgsql-novice@postgresql.org'; 'pgsql-sql@postgresql.org'
> > Subject: Re: [SQL] Passing arrays
> >
> >
> >
> > On Fri, 14 Feb 2003, Michael Weaver wrote:
> >
> > > How do you get an array of elements to be passed to a
> > stored proc such that
> > > you can use the array in a SELECT statement in the WHERE clause
> > >  - e.g.  WHERE field IN (array) etc...
> >
> > A straight WHERE field IN (array) doesn't work.  That's attempting to
> > compare the field directly to the array as a whole (which is
> > why you get
> > the particular error you do.
>
> I've got around this limitation using strings, but I do find it suprising,
> that Postgres handles arrays this way.
> Searching an array in an WHERE IN clause would be a useful task. (namely for
> passing arrays of values between stored functions)
>
> Ok it could be confusing, but I think a number of other DBs employ it to
> good effect.
>
> I'll take a look at the array extension in contrib - it sounds useful.

Also check out contrib/intarray and its indexing capabilites
if you have 1 dimensional integer arrays.

>
> Thanks.
>

==================================================================
Achilleus Mantzios
S/W Engineer
IT dept
Dynacom Tankers Mngmt
Nikis 4, Glyfada
Athens 16610
Greece
tel:    +30-10-8981112
fax:    +30-10-8981877
email:  achill@matrix.gatewaynet.com
        mantzios@softlab.ece.ntua.gr




view thread (11+ messages)  latest in thread

Message-ID: <Pine.LNX.4.44.0302141007300.16950-100000@matrix.gatewaynet.com>
Permalink:  ../Pine.LNX.4.44.0302141007300.16950-100000@matrix.gatewaynet.com/
Also on:    postgresql.org/message-id/Pine.LNX.4.44.0302141007300.16950-100000@matrix.gatewaynet.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: achill@matrix.gatewaynet.com, mweaver@corpusglobe.com, sszabo@megazone23.bigpanda.com, pgsql-novice@postgresql.org
  Subject: Re: [SQL] Passing arrays
  In-Reply-To: <Pine.LNX.4.44.0302141007300.16950-100000@matrix.gatewaynet.com>
  References: <3B663B41B350D311AEEF00A0C9254563201A72@VISION1> <Pine.LNX.4.44.0302141007300.16950-100000@matrix.gatewaynet.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox