X-Original-To: pgsql-sql-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 354609FABE7 for ; Mon, 26 Jun 2006 22:36:45 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 69034-02 for ; Mon, 26 Jun 2006 22:36:36 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by postgresql.org (Postfix) with ESMTP id 2F6E89FA5FC for ; Mon, 26 Jun 2006 22:36:35 -0300 (ADT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.7/8.13.7) with ESMTP id k5R1aMjD075212 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 26 Jun 2006 19:36:25 -0600 (MDT) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.6/8.13.6) with ESMTP id k5R1aM2F004325; Mon, 26 Jun 2006 19:36:22 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.6/8.13.6/Submit) id k5R1aMAa004324; Mon, 26 Jun 2006 19:36:22 -0600 (MDT) (envelope-from mfuhr) Date: Mon, 26 Jun 2006 19:36:22 -0600 From: Michael Fuhr To: Kyle Bateman Cc: pgsql-sql@postgresql.org Subject: Re: permissions from system catalogs Message-ID: <20060627013622.GA4184@winnie.fuhr.org> References: <44A06E04.5000206@actarg.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <44A06E04.5000206@actarg.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/278 X-Sequence-Number: 25514 On Mon, Jun 26, 2006 at 05:30:12PM -0600, Kyle Bateman wrote: > Can anyone point me where to look in the system catalogs (or information > schema) to determine in advance whether a given user (or the current > user) will have select permission to a given table or view? An easy way is to use the has_table_privilege() function. See also information schema views whose names contain the word "grants" or "privileges." http://www.postgresql.org/docs/8.1/interactive/functions-info.html#FUNCTIONS-INFO-ACCESS-TABLE http://www.postgresql.org/docs/8.1/interactive/information-schema.html (Adjust the version number in the above links if you're using a version other than 8.1) -- Michael Fuhr