Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZXDYP-0006qi-9s for pgsql-bugs@arkaria.postgresql.org; Wed, 02 Sep 2015 19:18:41 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZXDYO-0006Rg-Ru for pgsql-bugs@arkaria.postgresql.org; Wed, 02 Sep 2015 19:18:40 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZX9Ii-0006Om-9t for pgsql-bugs@postgresql.org; Wed, 02 Sep 2015 14:46:12 +0000 Received: from wrigleys.postgresql.org ([204.145.124.246]) by magus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1ZX9Ia-0000jI-4S for pgsql-bugs@postgresql.org; Wed, 02 Sep 2015 14:46:11 +0000 MIME-Version: 1.0 Subject: BUG #13607: Creating "Readonly" User for public Shema. To: pgsql-bugs@postgresql.org From: ugurlu2001@hotmail.com Date: Wed, 02 Sep 2015 14:45:58 +0000 Message-ID: <20150902144558.1367.52135@wrigleys.postgresql.org> X-Pg-Spam-Score: -1.0 (-) Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" 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 The following bug has been logged on the website: Bug reference: 13607 Logged by: Ugur YILMAZ Email address: ugurlu2001@hotmail.com PostgreSQL version: 9.4.0 Operating system: Widows 10 Pro x64 Description: 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. I hope you can add "ALTER" keyword for "GRANT/REVOKE" command to PostgreSQL The script at the abouve that I used : With my best regards. http://stackoverflow.com/questions/32352508/create-a-user-for-select-only-on-postgresql-restrict-alter-table CREATE ROLE readonly LOGIN PASSWORD 'thePwd'; -- Existing objects GRANT CONNECT ON DATABASE the_db TO readonly; GRANT USAGE ON SCHEMA public TO readonly; GRANT SELECT ON ALL TABLES IN SCHEMA public TO readonly; GRANT SELECT ON ALL SEQUENCES IN SCHEMA public TO readonly; GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA public TO readonly; -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs