pgsql: Ensure COPY TO on an RLS-enabled table copies no more than it sh
В списке pgsql-committers по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | pgsql: Ensure COPY TO on an RLS-enabled table copies no more than it sh |
| Дата | |
| Msg-id | E1pahrM-002t71-Sg@gemulon.postgresql.org обсуждение |
| Список | pgsql-committers |
Ensure COPY TO on an RLS-enabled table copies no more than it should. The COPY documentation is quite clear that "COPY relation TO" copies rows from only the named table, not any inheritance children it may have. However, if you enabled row-level security on the table then this stopped being true, because the code forgot to apply the ONLY modifier in the "SELECT ... FROM relation" query that it constructs in order to allow RLS predicates to be attached. Fix that. Report and patch by Antonin Houska (comment adjustments and test case by me). Back-patch to all supported branches. Discussion: https://postgr.es/m/3472.1675251957@antos Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/d66bb048c3130c7b7a4876fc9050291f9e4cad2b Modified Files -------------- src/backend/commands/copy.c | 5 ++++- src/backend/commands/copyto.c | 4 ++-- src/test/regress/expected/rowsecurity.out | 37 +++++++++++++++++++++++++++++++ src/test/regress/sql/rowsecurity.sql | 34 ++++++++++++++++++++++++++++ 4 files changed, 77 insertions(+), 3 deletions(-)
В списке pgsql-committers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера