Apply SELECT policies in INSERT/UPDATE+RETURNING

Stephen Frost <sfrost@snowman.net>

Commit: 2ca9d5445c35db8956e4abbf1e653373820e8c0a
Author: Stephen Frost <sfrost@snowman.net>
Date: 2015-10-05T11:55:13Z
Releases: 9.6.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