X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 0745B539DF for ; Sun, 27 Mar 2005 09:04:43 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 48242-06 for ; Sun, 27 Mar 2005 08:04:42 +0000 (GMT) Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by svr1.postgresql.org (Postfix) with ESMTP id 9B36553A06 for ; Sun, 27 Mar 2005 09:04:40 +0100 (BST) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.3/8.13.3) with ESMTP id j2R84akk038180 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 27 Mar 2005 01:04:38 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.3/8.13.3) with ESMTP id j2R84Zou046463; Sun, 27 Mar 2005 01:04:35 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.3/8.13.3/Submit) id j2R84ZEp046462; Sun, 27 Mar 2005 01:04:35 -0700 (MST) (envelope-from mfuhr) Date: Sun, 27 Mar 2005 01:04:35 -0700 From: Michael Fuhr To: Andrus Moor Cc: pgsql-sql@postgresql.org Subject: Re: select a list of schema names Message-ID: <20050327080435.GA46395@winnie.fuhr.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.004 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200503/352 X-Sequence-Number: 20831 On Fri, Mar 25, 2005 at 09:50:18PM +0200, Andrus Moor wrote: > > How to select a list of schema names which current user is authorized to > access ? See "System Catalogs" and "System Information Functions" (or "Miscellaneous Functions") in the documentation. Here are links to documentation for the latest release: http://www.postgresql.org/docs/8.0/interactive/catalogs.html http://www.postgresql.org/docs/8.0/interactive/functions-info.html Something like this might be what you're looking for: SELECT nspname FROM pg_namespace WHERE has_schema_privilege(nspname, 'USAGE') ORDER BY nspname; Note that USAGE privilege on a schema doesn't necessarily mean the user has any privileges on the objects in that schema. -- Michael Fuhr http://www.fuhr.org/~mfuhr/