BUG #16942: Misleading error message on denied permission for column in table

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: mihail(dot)gershkovich(at)gmail(dot)com
Subject: BUG #16942: Misleading error message on denied permission for column in table
Date: 2021-03-24 22:27:21
Message-ID: 16942-979301fdd7dd4a48@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 16942
Logged by: Mihail Gershkovich
Email address: mihail(dot)gershkovich(at)gmail(dot)com
PostgreSQL version: 13.0
Operating system: OpenSUSE
Description:

-- reproduce:

CREATE ROLE table_writer; CREATE ROLE table_reader; CREATE ROLE
table_processor;
GRANT column_reader TO column_writer;

CREATE TABLE column_access_test (open1 varchar, open2 varchar, closed1
varchar);

GRANT SELECT(open1,open2,closed1) ON column_access_test TO
table_processor;
GRANT INSERT(open1,open2, closed1 ), UPDATE(open1,open2, closed1 ) ON
column_access_test TO column_writer;
GRANT SELECT(open1,open2) ON column_access_test TO column_reader ;

SET ROLE column_reader;
SELECT open1, open2 from column_access_test; -- works fine
SELECT open1, open2, closed1 from column_access_test; -- access is
prohibited, as expected, but error message is misleading

/*
Error:
SQL Error [42501]: ERROR: permission denied for table XYZ
should be something like: ERROR: permission denied for column A in table B
makes troubleshooting of permissions cumbersome.
*/

Browse pgsql-bugs by date

  From Date Subject
Next Message egashira.yusuke@fujitsu.com 2021-03-25 00:23:52 RE: BUG #16922: In cascading replication, a standby server aborted when an upstream standby server promoted
Previous Message Boris P. Korzun 2021-03-24 20:38:50 Inconsistent behavior of pg_dump/pg_restore on DEFAULT PRIVILEGES