Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZXFfJ-0007oz-FJ for pgsql-bugs@arkaria.postgresql.org; Wed, 02 Sep 2015 21:33:57 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZXFfJ-0003oK-1D for pgsql-bugs@arkaria.postgresql.org; Wed, 02 Sep 2015 21:33:57 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZXFfI-0003oA-In for pgsql-bugs@postgresql.org; Wed, 02 Sep 2015 21:33:56 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZXFfG-0007al-62 for pgsql-bugs@postgresql.org; Wed, 02 Sep 2015 21:33:55 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id t82LXpdb018220; Wed, 2 Sep 2015 17:33:51 -0400 From: Tom Lane To: ugurlu2001@hotmail.com cc: pgsql-bugs@postgresql.org Subject: Re: BUG #13607: Creating "Readonly" User for public Shema. In-reply-to: <20150902144558.1367.52135@wrigleys.postgresql.org> References: <20150902144558.1367.52135@wrigleys.postgresql.org> Comments: In-reply-to ugurlu2001@hotmail.com message dated "Wed, 02 Sep 2015 14:45:58 -0000" Date: Wed, 02 Sep 2015 17:33:51 -0400 Message-ID: <18219.1441229631@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org ugurlu2001@hotmail.com writes: > I was create a readonly user on a testdb for my new project. There are two > user types at the project: postgres and readonly. The postgres user is > working in my program with admin rights and handling all concepts > (Transactions, Create, Drop, Maintenance etc...) . And I added readonly user > to my project; protect my tables against sql injections. readonly user only > runs SELECT STATEMENTS for reports. But when I test some tables; There is no > protect of my tables against "ALTER TABLE" commands. I think; that is an > importand bug on PostgreSQL. No, it's a mistake on your part. Hard to tell exactly what, since you provided no details of what you did to arrive at that conclusion; but it's easy to show that this is rejected: regression=# create table sample (f1 int); CREATE TABLE regression=# create user foo; CREATE ROLE regression=# grant select on table sample to foo; GRANT regression=# \c - foo You are now connected to database "regression" as user "foo". regression=> select * from sample; f1 ---- (0 rows) regression=> alter table sample add column f2 int; ERROR: must be owner of relation sample If you've found a way for a non-superuser non-owner of a table to do ALTER on it, please show an exact and complete example. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs