Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 4B6DFB5DC27 for ; Fri, 22 Jul 2011 11:14:17 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 34698-09 for ; Fri, 22 Jul 2011 14:14:11 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from nm3.bullet.mail.ac4.yahoo.com (nm3.bullet.mail.ac4.yahoo.com [98.139.52.200]) by mail.postgresql.org (Postfix) with SMTP id E6265B5DC0A for ; Fri, 22 Jul 2011 11:14:10 -0300 (ADT) Received: from [98.139.52.197] by nm3.bullet.mail.ac4.yahoo.com with NNFMP; 22 Jul 2011 14:14:09 -0000 Received: from [98.139.52.145] by tm10.bullet.mail.ac4.yahoo.com with NNFMP; 22 Jul 2011 14:14:09 -0000 Received: from [127.0.0.1] by omp1028.mail.ac4.yahoo.com with NNFMP; 22 Jul 2011 14:14:09 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 868497.93493.bm@omp1028.mail.ac4.yahoo.com Received: (qmail 28919 invoked by uid 60001); 22 Jul 2011 14:14:09 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1311344049; bh=8W9CVTxGDNlste0ZafNgRaN2TleoDpj+ZOkntxTv7RA=; h=X-YMail-OSG:Received:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=y2mVOfjesotKMQpiu00Lq+MHOoMmIXwJ1qnH3IwNv10xr/rNjbKUjt+fkUEvdho6R/C1n80WfMbE2U6yVnJvYQ/ZxBrISeOr5hg4F/8Dq9sKAGmsTbD/cKa+CK11XIBItuxSgRL7df1CY0b94EdXOel8NcMl5/4064ChAB7OO8k= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=qfNtLOZD8fnSRVabz52Mz6XokFeHXsIG0ZDl7ST9Jfh8aNhx5fkhjeIs3xbQiShrPRT6pcB+zL8QX1mSZrwQfXjVjONeq6FkN0AO6YqQicXyck9blfA/G4vaUsonOOHJl+VfGj3rVPBoHh4yc54GT9qHwibAwUjZL/9H2riGugw=; X-YMail-OSG: GQzFh9cVM1mV_ZTcEszgX5MryW4hbORh.KGOBPUlj6mVyr5 PO48PRprKfwIc6SWtL.JHDVKykFL1tsjBNYdMx854b8559PtBF5mllxqk5vg cnqtpL9qfWVLAG9OPr3xOGDfGmbK._bjjbzC2N8n0jwlzHvo2srk3mB.HK0Z TdxaZahnx.t3BED8Wm_wXRoUvpkq1rIisvcblz8eHrTNt3SJBOuRyv3FA5mf 3Q5gcDJduOmOQnHMpufBT5dNVLtzbsKvltmHakmDTVm8xu1xYf8A0cZMcI2A 8n_Rkz_eXq_4M5P7B580TAZhs3k2lY4.vhPEHGlnY4AAbdpvMzbMczXotMVI zANg8Qr8uJzL3hm1EkyUzTrRkZbxu_b8LBOjiEAorReUhujGSINJWEW6AyZf szeAB_Pxkr3mh443AVaYELBe1XpKqzeXvgDiAhevoNCjxukJzAdUvE78tKWA p.j5AYZWBwBtl5NLCQcNQ56Ig64biWtpd5Q-- Received: from [64.126.29.122] by web39701.mail.mud.yahoo.com via HTTP; Fri, 22 Jul 2011 07:14:09 PDT X-Mailer: YahooMailWebService/0.8.112.307740 References: <4E28BF6E.8090302@quality-telecom.net> <4E297A07.9090907@quality-telecom.net> Message-ID: <1311344049.24170.YahooMailNeo@web39701.mail.mud.yahoo.com> Date: Fri, 22 Jul 2011 07:14:09 -0700 (PDT) From: Bob Lunney Reply-To: Bob Lunney Subject: Re: revoked permissions on table still allows users to see table's structure To: "Juan Cuervo \(Quality Telecom\)" Cc: "pgsql-admin@postgresql.org" In-Reply-To: <4E297A07.9090907@quality-telecom.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-3.08 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RP_MATCHES_RCVD=-1.181 X-Spam-Level: X-Archive-Number: 201107/167 X-Sequence-Number: 37946 Juan,=0A=0AThat is what schemas, permissions and search paths are for. =A0Y= ou create multiple schemas, put the tables in the appropriate ones, grant u= sage permissions to those users that need access to the schemas and set the= search path to search the schemas for objects. =A0Below is the test case. = =A0It helps if you reset the psql prompt to display the current user:=0A=0A= \set PROMPT1 '%m:%>:%n:%/:%R%x%# '=0A=0AAs the database owner:=0A=0Acreate = schema seethat;=0Acreate schema seewhat;=0Acreate user al_low;=0Acreate use= r dee_ny;=0Agrant usage on schema seethat to al_low, dee_ny;=0Agrant usage = on schema seewhat to al_low;=0Aset search_path to seethat, seewhat, public;= =0A=0Acreate table seethat.open(open_id int);=0Acreate table seewhat.closed= (closed_id int);=0A=0A=0Aset session authorization al_low;=0A=0A\d=0A=0A=0A= set session authorization dee_ny;=0A=0A\d=0A=0A=0AHope that helps!=0A=0ABob= Lunney=0A=0A----- Original Message -----=0AFrom: Juan Cuervo (Quality Tele= com) =0ATo: Scott Marlowe =0ACc: pgsql-admin@postgresql.org=0ASent: Friday, July 22, 2011 8:= 24 AM=0ASubject: Re: [ADMIN] revoked permissions on table still allows user= s to see table's structure=0A=0AHi Scott=0A=0AThanks for your answer.=0A=0A= It should be a way to prevent this from normal users who only need =0Aacces= s to a set of tables, a view or even a store procedure. (Maybe a =0AVIEW_SC= HEMA privilege of roles?). View a table's structure should only =0Abe allow= ed to users who has at least one privilege on the table.=0A=0AIt doesnt mak= e much sense to me that every user with access to the =0Adatabase , would b= e able to see the whole database design.=0A=0ADo you know if this is common= in other RDBMS ?=0A=0ARegards,=0A=0AJuan R. Cuervo Soto=0AQuality Telecom = Ltd=0Awww.quality-telecom.net=0APBX : (575) 3693300=0ACEL : (57)=A0 301-417= 4865=0A=0A=0AEl 21/07/2011 08:48 p.m., Scott Marlowe escribi=F3:=0A> On Thu= , Jul 21, 2011 at 6:08 PM, Juan Cuervo (Quality Telecom)=0A> =A0 wrote:=0A>> Hi All=0A>>=0A>> I'm new to the list, bu= t have a few years as postgres user. I want to share=0A>> what I consider a= rare behavior of postgresql regarding database object's=0A>> premissions:= =0A>>=0A>> I have noticed that there is no way (at least no one I know) to = prevent a=0A>> user from seeing the table's structures in a database.=0A>>= =0A>> Is this a normal behavior of the product ?=0A> Yep.=A0 Completely nor= mal.=0A>=0A>> Is there a way to prevent a user from seeing my table's, proc= edure's and=0A>> function's code ?=0A> Don't let them connect to the db?=A0= That's all I can think of.=0A>=0A=0A-- =0ASent via pgsql-admin mailing lis= t (pgsql-admin@postgresql.org)=0ATo make changes to your subscription:=0Aht= tp://www.postgresql.org/mailpref/pgsql-admin=0A