Re: CREATE POLICY and RETURNING - Mailing list pgsql-hackers

From Stephen Frost
Subject Re: CREATE POLICY and RETURNING
Date
Msg-id 20141017114610.GT28859@tamriel.snowman.net
Whole thread Raw
In response to Re: CREATE POLICY and RETURNING  (Thom Brown <thom@linux.com>)
Responses Re: CREATE POLICY and RETURNING
List pgsql-hackers
* Thom Brown (thom@linux.com) wrote:
> On 17 October 2014 07:57, Craig Ringer <craig@2ndquadrant.com> wrote:
> > On 10/17/2014 02:49 AM, Robert Haas wrote:
> > > I think you could probably make the DELETE policy control what can get
> > > deleted, but then have the SELECT policy further filter what gets
> > > returned.
> >
> > That seems like the worst of both worlds to me.
> >
> > Suddenly DELETE ... RETURNING might delete more rows than it reports a
> > resultset for. As well as being potentially dangerous for people using
> > it in wCTEs, etc, to me that's the most astonishing possible outcome of
> > all.
> >
> > I'd be much happier with even:
> >
> >   ERROR: RETURNING not permitted with SELECT row-security policy
> >
> > than this.
>
> +1
>
> This suggestion is most in line with what I would expect to occur.

This was along the lines that I've been thinking for how to address this
also and I think it's the least surprising- but I want it controllable..

Thoughts on 'WITH RETURNING' / 'WITHOUT RETURNING' and what the default
should be?
Thanks!
    Stephen

pgsql-hackers by date:

Previous
From: Stephen Frost
Date:
Subject: Re: CREATE POLICY and RETURNING
Next
From: Amit Kapila
Date:
Subject: Re: TODO : Allow parallel cores to be used by vacuumdb [ WIP ]