pgsql: Improve RLS handling in copy.c

Поиск
Список
Период
Сортировка
От Stephen Frost
Тема pgsql: Improve RLS handling in copy.c
Дата
Msg-id E1ZJpKt-0006x6-KC@gemulon.postgresql.org
обсуждение исходный текст
Список 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(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: pgsql: Further code review for pg_stat_ssl patch.
Следующее
От: Stephen Frost
Дата:
Сообщение: pgsql: Improve RLS handling in copy.c