git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: c45dc7f) | patch
Ensure COPY TO on an RLS-enabled table copies no more than it should.
2023年3月10日 18:52:28 +0000 (13:52 -0500)
2023年3月10日 18:52:44 +0000 (13:52 -0500)
commit d66bb048c3130c7b7a4876fc9050291f9e4cad2b
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
src/backend/commands/copy.c diff | blob | blame | history
src/backend/commands/copyto.c diff | blob | blame | history
src/test/regress/expected/rowsecurity.out diff | blob | blame | history
src/test/regress/sql/rowsecurity.sql diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /