pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephan Szabo <sszabo@megazone23.bigpanda.com>
To: Kelly <quadratini@sni.ph>
Cc: pgsql-sql@postgresql.org
Subject: Re: selecting from integer[]
Date: Sat, 29 Jun 2002 14:11:19 -0700 (PDT)
Message-ID: <20020629140955.L51866-100000@megazone23.bigpanda.com> (raw)
In-Reply-To: <3D1D9EA9.3090604@sni.ph>

On Sat, 29 Jun 2002, Kelly wrote:

> select * from pg_user where usesysid=(select grolist[1] from pg_group
> where groname='mygroup');
> select * from pg_user where usesysid=(select grolist[2] from pg_group
> where groname='mygroup');
> select * from pg_user where usesysid=(select grolist[3] from pg_group
> where groname='mygroup');
>
> Can those three queries be merged to one query? (and still gives me
> those three rows)
> Or do I have to explicitly say grolist[1], grolist[2], etc....

If you want to do "is element in array," I believe the array iterator
functions in contrib/array might help you.






view thread (3+ messages)

Message-ID: <20020629140955.L51866-100000@megazone23.bigpanda.com>
Permalink:  ../20020629140955.L51866-100000@megazone23.bigpanda.com/
Also on:    postgresql.org/message-id/20020629140955.L51866-100000@megazone23.bigpanda.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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: sszabo@megazone23.bigpanda.com, quadratini@sni.ph
  Subject: Re: selecting from integer[]
  In-Reply-To: <20020629140955.L51866-100000@megazone23.bigpanda.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