X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id A6143D1D26F for ; Fri, 27 Feb 2004 10:32:35 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 02122-10 for ; Fri, 27 Feb 2004 06:32:32 -0400 (AST) Received: from io.scheffers.net (io.scheffers.net [194.109.161.112]) by svr1.postgresql.org (Postfix) with SMTP id 33DFAD1B9BE for ; Fri, 27 Feb 2004 06:32:29 -0400 (AST) Received: (qmail 8825 invoked from network); 27 Feb 2004 10:32:26 -0000 Received: from localhost (HELO io.scheffers.net) (127.0.0.1) by localhost with SMTP; 27 Feb 2004 10:32:26 -0000 Received: from 217.205.40.94 (SquirrelMail authenticated user bas) by io.scheffers.net with HTTP; Fri, 27 Feb 2004 10:32:26 -0000 (GMT) Message-ID: <4016.217.205.40.94.1077877946.squirrel@io.scheffers.net> Date: Fri, 27 Feb 2004 10:32:26 -0000 (GMT) Subject: Re: Help with a query From: "Bas Scheffers" To: pgsql-general@postgresql.org Cc: alex@toomuchspace.com Reply-To: bas@scheffers.net User-Agent: SquirrelMail/1.4.2 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 Importance: Normal X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200402/1166 X-Sequence-Number: 57877 If the user/groups you are talking about are postgres users and groups, this is it: select * from pg_catalog.pg_group where (select usesysid from pg_catalog.pg_user where usename = 'user') = any(grolist) The place to find this kind of thing is the Postgres Internals section (system catalogs) that desribes the system tables. "any" is an array function which is needed as the users that belong to a group are an array of INT user ids. Hope that helps, Bas.