Re: Insert..returning (was Re: Re: postgres TODO)

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Philip Warner <pjw@rhyme.com.au>
Cc: darcy@druid.net (D'Arcy J.M. Cain), Michael J Schout <mschout@gkg.net>, Alessio Bragadini <alessio@albourne.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2000-07-12T16:47:11Z
Lists: pgsql-hackers
Philip Warner <pjw@rhyme.com.au> writes:
>> I think the thing he has in mind is the situation where one has insert
>> perms but not select.

Exactly --- and that's a perfectly reasonable setup in some cases (think
blind mailbox).  INSERT ... RETURNING should require both insert and
select privileges IMHO.

> I would be inclined to follow the perms; is there a problem with that? You
> should not let them read the row they inserted since it *may* contain
> sensitive (automatically generated) data - the DBA must have had a reason
> for preventing SELECT.

It would be a pretty stupid app that would be using INSERT ... RETURNING
to obtain the data that it itself is supplying.  The only reason I can
see for the feature is to get hold of automatically-generated column
values.  Thus, obeying select permissions is relevant.

			regards, tom lane