pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Stephen Frost <sfrost@snowman.net>
Cc: Yugo NAGATA <nagata@sraoss.co.jp>
Cc: Antonin Houska <ah@cybertec.at>
Cc: pgsql-hackers@postgresql.org
Subject: Re: RLS makes COPY TO process child tables
Date: Fri, 10 Mar 2023 13:57:55 -0500
Message-ID: <978238.1678474675@sss.pgh.pa.us> (raw)
In-Reply-To: <Y+L0jZJkHvgdOZRA@tamriel.snowman.net>
References: <3472.1675251957@antos>
	<20230202011525.c7c05900bcf791f868d72a51@sraoss.co.jp>
	<1379089.1675270043@sss.pgh.pa.us>
	<20230202160031.defd38f35433c7677b48a8ec@sraoss.co.jp>
	<Y+L0jZJkHvgdOZRA@tamriel.snowman.net>

Stephen Frost <sfrost@snowman.net> writes:
> Yeah, that should also be updated.  Perhaps you'd send an updated patch
> which includes fixing that too and maybe adds clarifying documentation
> to COPY which mentions what happens when RLS is enabled on the relation?

I couldn't find anything in copy.sgml that seemed to need adjustment.
It already says

    If row-level security is enabled for the table, the relevant SELECT
    policies will apply to COPY table TO statements.

Together with the already-mentioned

    COPY table TO copies the same rows as SELECT * FROM ONLY table.

I'd say that the behavior is very clearly specified already.  We just
need to make the code do what the docs say.  So I pushed the patch
without any docs changes.  I did add a test case, because I don't
like back-patching without something that proves that the issue is
relevant to, and corrected in, each branch.

			regards, tom lane





view thread (8+ messages)

Message-ID: <978238.1678474675@sss.pgh.pa.us>
Permalink:  ../978238.1678474675@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/978238.1678474675@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, sfrost@snowman.net, nagata@sraoss.co.jp, ah@cybertec.at
  Subject: Re: RLS makes COPY TO process child tables
  In-Reply-To: <978238.1678474675@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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