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

From Stephen Frost
Subject Re: CREATE POLICY and RETURNING
Date
Msg-id 20141017115452.GV28859@tamriel.snowman.net
Whole thread Raw
In response to Re: CREATE POLICY and RETURNING  (David G Johnston <david.g.johnston@gmail.com>)
List pgsql-hackers
* David G Johnston (david.g.johnston@gmail.com) wrote:
> How about returning a placeholder row but with all the values replaced with
> NULL?

I don't think that would be a good approach..  A user actually looking
at those rows would be highly confused.

> In the absence of returning does the delete count show the total number of
> rows deleted or only the number of rows deleted that the user would be aware
> of if they issued a select with the same criteria?  Whatever the answer the
> number of rows returned with returning should match the row count normally
> noted.

Today, everything matches up, yes.  Having rows which are deleted but
which don't show up in RETURNING could certainly surprise people and
applications, which is why I tend to favor the 'all-or-error' approach
that others have also suggested.  Adding that wouldn't be difficult,
though we'd need to decide which should be the default.
Thanks!
    Stephen

pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: TODO : Allow parallel cores to be used by vacuumdb [ WIP ]
Next
From: Fujii Masao
Date:
Subject: Re: BUG: *FF WALs under 9.2 (WAS: .ready files appearing on slaves)