Re: COPY command with RLS bug - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: COPY command with RLS bug
Date
Msg-id CANP8+jL_q02yODTOzJuSudffsVMYhbR1Y3McWfPJCspf5WA1VA@mail.gmail.com
Whole thread Raw
In response to COPY command with RLS bug  (Adam Brightwell <adam.brightwell@crunchydata.com>)
Responses Re: COPY command with RLS bug
List pgsql-hackers
On 8 September 2016 at 20:13, Adam Brightwell
<adam.brightwell@crunchydata.com> wrote:

> I have discovered a bug with the COPY command, specifically related to RLS.
...
> Connecting as a non-privileged user provides the following results:
...
> COPY foo (a, b, c) TO stdout; -- fail
> ERROR:  missing FROM-clause entry for table "b"
> LINE 1: copy foo (a, b, c) to stdout;
...
> The issue seems to be that the target list for the resulting SELECT
> statement is not being built correctly. I have attached a proposed
> patch to fix this issue.  As well, I have added a few regression tests
> for this case.

Thanks for the report and the fix.

This seems a rather basic error to occur a year after release.

Is this a problem with the testing of RLS? What other RLS related
failures exist in other commands?

Perhaps we should extend rowsecurity test with a more comprehensive
set of tests rather than just fix the COPY one?

-- 
Simon Riggs                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



pgsql-hackers by date:

Previous
From: Masahiko Sawada
Date:
Subject: Re: Vacuum: allow usage of more than 1GB of work mem
Next
From: Devrim Gündüz
Date:
Subject: Re: ICU integration