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