pgsql: Improve reporting of permission errors for array types - Mailing list pgsql-committers

From Peter Eisentraut
Subject pgsql: Improve reporting of permission errors for array types
Date
Msg-id E1SfeDS-0000wm-43@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Improve reporting of permission errors for array types

Because permissions are assigned to element types, not array types,
complaining about permission denied on an array type would be
misleading to users.  So adjust the reporting to refer to the element
type instead.

In order not to duplicate the required logic in two dozen places,
refactor the permission denied reporting for types a bit.

pointed out by Yeb Havinga during the review of the type privilege
feature

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/15b1918e7d3532f0e4ec3455ae6ce45fae09c86f

Modified Files
--------------
src/backend/access/common/tupdesc.c      |    3 +--
src/backend/catalog/aclchk.c             |   13 +++++++++++++
src/backend/catalog/objectaddress.c      |    3 +--
src/backend/catalog/pg_aggregate.c       |    9 +++------
src/backend/commands/functioncmds.c      |   12 ++++--------
src/backend/commands/opclasscmds.c       |    6 ++----
src/backend/commands/operatorcmds.c      |    9 +++------
src/backend/commands/tablecmds.c         |    9 +++------
src/backend/commands/typecmds.c          |   18 ++++++------------
src/include/utils/acl.h                  |    2 ++
src/test/regress/expected/privileges.out |    2 +-
11 files changed, 39 insertions(+), 47 deletions(-)


pgsql-committers by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: pgsql: New SQL functons pg_backup_in_progress() and pg_backup_start_tim
Next
From: Peter Eisentraut
Date:
Subject: pgsql: Improve reporting of permission errors for array types