X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 198E89DC9A0 for ; Sun, 26 Mar 2006 16:35:05 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 85255-03 for ; Sun, 26 Mar 2006 16:35:05 -0400 (AST) Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id 048AC9DC8A5 for ; Sun, 26 Mar 2006 16:35:03 -0400 (AST) Received: from hyperion.stayhosted.com (hyperion.stayhosted.com [70.84.193.98]) by svr4.postgresql.org (Postfix) with ESMTP id EFCDB5AF195 for ; Sun, 26 Mar 2006 20:35:00 +0000 (GMT) Received: from host86-141-61-176.range86-141.btcentralplus.com ([86.141.61.176]) by hyperion.stayhosted.com with esmtpa (Exim 4.52) id 1FNbww-0003KG-0h for pgsql-admin@postgresql.org; Sun, 26 Mar 2006 20:34:59 +0000 Message-ID: <4426FAEB.6030205@gmail.com> Date: Sun, 26 Mar 2006 21:34:51 +0100 From: Milen Dzhumerov User-Agent: Thunderbird 1.5 (Windows/20051201) MIME-Version: 1.0 To: pgsql-admin@postgresql.org Subject: Table permissions Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - hyperion.stayhosted.com X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [47 12] X-AntiAbuse: Sender Address Domain - gmail.com X-Source: X-Source-Args: X-Source-Dir: X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[none] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200603/277 X-Sequence-Number: 21034 Hi all, I had the need to find the user permissions of several tables. I figured out that if I submit the query SELECT relacl FROM pg_catalog.pg_class WHERE relname = 'tablename'; I get the permissions but for the table name in all schemas and not only the one I'm interested in. Then I took a look at psql's source and I found the query for figuring out the permissions on a table in the describe.c file (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/bin/psql/describe.c?rev=1.133). Unfortunately if I try to submit it, it gives me some error. It cannot recognize the "n.nspname" token and other similar errors. So can anyone help me with constructing an SQL query to figure out the permissions on a table in a specific schema? My other question is who has access to the pg_catalog.* tables? Is it true that every user can examine them? And are these tables per database or shared across PgSQL? Is is true that every user can check if he/she has access to a particular table and examine the ACL string? And how can I determine if a user can change permissions for other users? Kind regards, gamehack