postgresql/src/backend/catalog
Joe Conway b12bd4869b Fix has_column_privilege function corner case
According to the comments, when an invalid or dropped column oid is passed
to has_column_privilege(), the intention has always been to return NULL.
However, when the caller had table level privilege the invalid/missing
column was never discovered, because table permissions were checked first.

Fix that by introducing extended versions of pg_attribute_acl(check|mask)
and pg_class_acl(check|mask) which take a new argument, is_missing. When
is_missing is NULL, the old behavior is preserved. But when is_missing is
passed by the caller, no ERROR is thrown for dropped or missing
columns/relations, and is_missing is flipped to true. This in turn allows
has_column_privilege to check for column privileges first, providing the
desired semantics.

Not backpatched since it is a user visible behavioral change with no previous
complaints, and the fix is a bit on the invasive side.

Author: Joe Conway
Reviewed-By: Tom Lane
Reported by: Ian Barwick
Discussion: https://postgr.es/m/flat/9b5f4311-157b-4164-7fe7-077b4fe8ed84%40joeconway.com
2021-03-31 13:55:25 -04:00
..
.gitignore Build in some knowledge about foreign-key relationships in the catalogs. 2021-02-02 17:11:55 -05:00
Catalog.pm Build in some knowledge about foreign-key relationships in the catalogs. 2021-02-02 17:11:55 -05:00
Makefile Extended statistics on expressions 2021-03-27 00:01:11 +01:00
aclchk.c Fix has_column_privilege function corner case 2021-03-31 13:55:25 -04:00
catalog.c Log when GetNewOidWithIndex() fails to find unused OID many times. 2021-03-24 10:36:56 +09:00
dependency.c Use errmsg_internal for debug messages 2021-02-17 11:33:25 +01:00
genbki.pl Allow configurable LZ4 TOAST compression. 2021-03-19 15:10:38 -04:00
heap.c ALTER TABLE ... DETACH PARTITION ... CONCURRENTLY 2021-03-25 18:00:28 -03:00
index.c Fix interaction of TOAST compression with expression indexes. 2021-03-25 19:55:32 -04:00
indexing.c Fix comment in indexing.c 2021-03-17 18:07:00 +09:00
information_schema.sql Add "pg_database_owner" default role. 2021-03-26 10:42:17 -07:00
namespace.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
objectaccess.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
objectaddress.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
partition.c ALTER TABLE ... DETACH PARTITION ... CONCURRENTLY 2021-03-25 18:00:28 -03:00
pg_aggregate.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
pg_cast.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
pg_collation.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
pg_constraint.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
pg_conversion.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
pg_db_role_setting.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
pg_depend.c Hide internal error for pg_collation_actual_version(<bad OID>). 2021-02-22 23:01:20 +13:00
pg_enum.c Rename "enum blacklist" to "uncommitted enums". 2021-01-05 12:38:48 +13:00
pg_inherits.c ALTER TABLE ... DETACH PARTITION ... CONCURRENTLY 2021-03-25 18:00:28 -03:00
pg_largeobject.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
pg_namespace.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
pg_operator.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
pg_proc.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
pg_publication.c Add macro RelationIsPermanent() to report relation permanence 2021-03-22 20:23:52 -04:00
pg_range.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
pg_shdepend.c Prevent drop of tablespaces used by partitioned relations 2021-01-14 15:32:14 -03:00
pg_subscription.c Fix relcache reference leak introduced by ce0fdbfe97. 2021-02-25 07:48:24 +05:30
pg_type.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
sql_feature_packages.txt Cleanup in SQL features files 2020-03-28 08:46:18 +01:00
sql_features.txt Allow an alias to be attached to a JOIN ... USING 2021-03-31 17:10:50 +02:00
storage.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
system_views.sql Improve consistency of SQL code capitalization 2021-03-27 10:17:12 +01:00
toasting.c Allow configurable LZ4 TOAST compression. 2021-03-19 15:10:38 -04:00