X-Original-To: pgsql-novice@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 76C04474E4F; Fri, 14 Feb 2003 03:08:56 -0500 (EST) Received: from matrix.gatewaynet.com (unknown [217.19.69.50]) by postgresql.org (Postfix) with ESMTP id 23BFF474E42; Fri, 14 Feb 2003 03:08:55 -0500 (EST) Received: from matrix.gatewaynet.com (matrix.gatewaynet.com [217.19.69.50] (may be forged)) by matrix.gatewaynet.com (8.12.5/8.12.5) with ESMTP id h1ECABIs021021; Fri, 14 Feb 2003 10:10:11 -0200 Received: from localhost (achill@localhost) by matrix.gatewaynet.com (8.12.5/8.12.5/Submit) with ESMTP id h1ECA936021017; Fri, 14 Feb 2003 10:10:10 -0200 Date: Fri, 14 Feb 2003 10:10:09 -0200 (GMT+2) From: Achilleus Mantzios To: Michael Weaver Cc: "'Stephan Szabo'" , "'pgsql-novice@postgresql.org'" , "'pgsql-sql@postgresql.org'" Subject: Re: [SQL] Passing arrays In-Reply-To: <3B663B41B350D311AEEF00A0C9254563201A72@VISION1> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200302/179 X-Sequence-Number: 6195 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