pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: ugurlu2001@hotmail.com
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #13607: Creating "Readonly" User for public Shema.
Date: Wed, 02 Sep 2015 17:33:51 -0400
Message-ID: <18219.1441229631@sss.pgh.pa.us> (raw)
In-Reply-To: <20150902144558.1367.52135@wrigleys.postgresql.org>
References: <20150902144558.1367.52135@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

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



view thread (2+ messages)

Message-ID: <18219.1441229631@sss.pgh.pa.us>
Permalink:  ../18219.1441229631@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/18219.1441229631@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, ugurlu2001@hotmail.com
  Subject: Re: BUG #13607: Creating "Readonly" User for public Shema.
  In-Reply-To: <18219.1441229631@sss.pgh.pa.us>
  References: <20150902144558.1367.52135@wrigleys.postgresql.org> <18219.1441229631@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox