pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Improve RLS handling in copy.c 2+ messages / 1 participants [nested] [flat]
* pgsql: Improve RLS handling in copy.c @ 2015-07-27 20:49 Stephen Frost <sfrost@snowman.net> 0 siblings, 0 replies; 2+ messages in thread From: Stephen Frost @ 2015-07-27 20:49 UTC (permalink / raw) To: pgsql-committers Improve RLS handling in copy.c To avoid a race condition where the relation being COPY'd could be changed into a view or otherwise modified, keep the original lock on the relation. Further, fully qualify the relation when building the query up. Also remove the poorly thought-out Assert() and check the entire relationOids list as, post-RLS, there can certainly be multiple relations involved and the planner does not guarantee their ordering. Per discussion with Noah and Andres. Back-patch to 9.5 where RLS was introduced. Branch ------ master Details ------- http://git.postgresql.org/pg/commitdiff/3d5cb31c9a17bad8bbc587c09404b2aa1e6c3aac Modified Files -------------- src/backend/commands/copy.c | 45 +++++++++++++++---------- src/test/regress/expected/rowsecurity.out | 50 +++++++++++++++++++++++++++- src/test/regress/sql/rowsecurity.sql | 51 ++++++++++++++++++++++++++++- 3 files changed, 126 insertions(+), 20 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 2+ messages in thread
* pgsql: Improve RLS handling in copy.c @ 2015-07-27 20:49 Stephen Frost <sfrost@snowman.net> 0 siblings, 0 replies; 2+ messages in thread From: Stephen Frost @ 2015-07-27 20:49 UTC (permalink / raw) To: pgsql-committers Improve RLS handling in copy.c To avoid a race condition where the relation being COPY'd could be changed into a view or otherwise modified, keep the original lock on the relation. Further, fully qualify the relation when building the query up. Also remove the poorly thought-out Assert() and check the entire relationOids list as, post-RLS, there can certainly be multiple relations involved and the planner does not guarantee their ordering. Per discussion with Noah and Andres. Back-patch to 9.5 where RLS was introduced. Branch ------ REL9_5_STABLE Details ------- http://git.postgresql.org/pg/commitdiff/5d179a28fb4c819f3812c40fa7e626b1d3081982 Modified Files -------------- src/backend/commands/copy.c | 45 +++++++++++++++---------- src/test/regress/expected/rowsecurity.out | 50 +++++++++++++++++++++++++++- src/test/regress/sql/rowsecurity.sql | 51 ++++++++++++++++++++++++++++- 3 files changed, 126 insertions(+), 20 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2015-07-27 20:49 UTC | newest] Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2015-07-27 20:49 pgsql: Improve RLS handling in copy.c Stephen Frost <sfrost@snowman.net> 2015-07-27 20:49 pgsql: Improve RLS handling in copy.c Stephen Frost <sfrost@snowman.net>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox