Apply SELECT policies in INSERT/UPDATE+RETURNING

Stephen Frost <sfrost@snowman.net>

Commit: bd9014768035dd70f8cc33c215a8b929c2e13a35
Author: Stephen Frost <sfrost@snowman.net>
Date: 2015-10-05T11:55:11Z
Releases: 9.5.0
Apply SELECT policies in INSERT/UPDATE+RETURNING

Similar to 7d8db3e, given that INSERT+RETURNING requires SELECT rights
on the table, apply the SELECT policies as WCOs to the tuples being
inserted.  Apply the same logic to UPDATE+RETURNING.

Back-patch to 9.5 where RLS was added.

Files

PathChange+/−
src/backend/rewrite/rowsecurity.c modified +29 −3