1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-30 06:01:21 +03:00

Improve RLS documentation with respect to COPY

Documentation for pg_restore said COPY TO does not support row security
when in fact it should say COPY FROM. Fix that.

While at it, make it clear that "COPY FROM" does not allow RLS to be
enabled and INSERT should be used instead. Also that SELECT policies
will apply to COPY TO statements.

Back-patch to 9.5 where RLS first appeared.

Author: Joe Conway
Reviewed-By: Dean Rasheed and Robert Haas
Discussion: https://postgr.es/m/5744FA24.3030008%40joeconway.com
This commit is contained in:
Joe Conway
2016-12-22 17:56:50 -08:00
parent 2ac3ef7a01
commit 0a85c10225
3 changed files with 15 additions and 1 deletions

View File

@@ -424,6 +424,15 @@ COPY <replaceable class="parameter">count</replaceable>
to have column privileges on the column(s) listed in the command.
</para>
<para>
If row-level security is enabled for the table, the relevant
<command>SELECT</command> policies will apply to <literal>COPY
<replaceable class="parameter">table</> TO</literal> statements.
Currently, <command>COPY FROM</command> is not supported for tables
with row-level security. Use equivalent <command>INSERT</command>
statements instead.
</para>
<para>
Files named in a <command>COPY</command> command are read or written
directly by the server, not by the client application. Therefore,