Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 4F123B5DC32 for ; Thu, 21 Jul 2011 21:15:26 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 45538-06 for ; Fri, 22 Jul 2011 00:15:20 +0000 (UTC) X-Greylist: delayed 00:06:40.242198 by SQLgrey-1.7.6 Received: from mail25.opentransfer.com (mail25.opentransfer.com [76.162.254.25]) by mail.postgresql.org (Postfix) with SMTP id C543CB5D8C5 for ; Thu, 21 Jul 2011 21:15:19 -0300 (ADT) Received: (qmail 30004 invoked by uid 399); 22 Jul 2011 00:08:37 -0000 Received: from unknown (HELO ?192.168.0.16?) (juanrcuervo@quality-telecom.net@190.1.135.54) by mail25.opentransfer.com with SMTP; 22 Jul 2011 00:08:37 -0000 Message-ID: <4E28BF6E.8090302@quality-telecom.net> Date: Thu, 21 Jul 2011 19:08:14 -0500 From: "Juan Cuervo (Quality Telecom)" Organization: Quality Telecom User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20110624 Thunderbird/5.0 MIME-Version: 1.0 To: pgsql-admin@postgresql.org Subject: revoked permissions on table still allows users to see table's structure Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201107/161 X-Sequence-Number: 37940 Hi All I'm new to the list, but have a few years as postgres user. I want to share what I consider a rare behavior of postgresql regarding database object's premissions: I have noticed that there is no way (at least no one I know) to prevent a user from seeing the table's structures in a database. I created a new user (user1) and do the following: 'revoke all on all tables in schema public from public;' After that, user1 cant do select, inserts , etc from database's tables. But still is able to see my table's structure: voicemax=>select * from tasks; ERROR: permission denied for relation tasks voicemax=> delete from tasks where task_id=6; ERROR: permission denied for relation tasks voicemax=> \d tasks Table "public.tasks" Column | Type | Modifiers -----------------+------------------------+--------------------------------------------------------- task_id | bigint | not null task_name | character varying(32) | not null description | character varying(128) | enabled | integer | default 0 Indexes: "tasks_task_name_key" UNIQUE, btree (task_name) The same behavior occurs when this user is logged from pgAdmin. User can see all table's structure, even if have no privileges on database tables. Is this a normal behavior of the product ? Is there a way to prevent a user from seeing my table's, procedure's and function's code ? Thanks in advance. -- Juan R. Cuervo Soto Quality Telecom Ltd www.quality-telecom.net PBX : (575) 3693300 CEL : (57) 301-4174865