postgresql/src/include/utils
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 Revert "Add gitignore entries for jsonpath_gram.h" 2019-03-23 00:19:34 +01:00
acl.h Fix has_column_privilege function corner case 2021-03-31 13:55:25 -04:00
aclchk_internal.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
array.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
arrayaccess.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
ascii.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
attoptcache.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
builtins.h Rework refactoring of hex and encoding routines 2021-01-14 11:13:24 +09:00
bytea.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
cash.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
catcache.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
combocid.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
date.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
datetime.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
datum.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
dsa.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
dynahash.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
elog.h Add errhint_plural() function and make use of it 2021-03-31 09:16:25 +02:00
evtcache.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
expandeddatum.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
expandedrecord.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
float.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
fmgrtab.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
formatting.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
freepage.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
geo_decls.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
guc.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
guc_tables.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
help_config.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
hsearch.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
index_selfuncs.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
inet.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
int8.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
inval.h Replace CLOBBER_CACHE_ALWAYS with run-time GUC 2021-01-06 10:46:44 +01:00
json.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
jsonb.h Implementation of subscripting for jsonb 2021-01-31 23:50:40 +03:00
jsonfuncs.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
jsonpath.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
logtape.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
lsyscache.h Preserve pg_attribute.attstattarget across REINDEX CONCURRENTLY 2021-02-10 13:06:48 +09:00
memdebug.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
memutils.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
multirangetypes.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
numeric.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
old_snapshot.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
palloc.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
partcache.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
pg_crc.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
pg_locale.h Hide internal error for pg_collation_actual_version(<bad OID>). 2021-02-22 23:01:20 +13:00
pg_lsn.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
pg_rusage.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
pidfile.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
plancache.h Improve performance of repeated CALLs within plpgsql procedures. 2021-01-25 22:28:29 -05:00
portal.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
ps_status.h Refactor ps_status.c API 2020-03-11 16:38:31 +01:00
queryenvironment.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
rangetypes.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
regproc.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
rel.h Revert "Enable parallel SELECT for "INSERT INTO ... SELECT ..."." 2021-03-24 11:29:15 +05:30
relcache.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
relfilenodemap.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
relmapper.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
relptr.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
reltrigger.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
resowner.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
resowner_private.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
rls.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
ruleutils.h Extended statistics on expressions 2021-03-27 00:01:11 +01:00
sampling.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
selfuncs.h Allow estimate_num_groups() to pass back further details about the estimation 2021-03-30 20:52:46 +13:00
sharedtuplestore.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
snapmgr.h ALTER TABLE ... DETACH PARTITION ... CONCURRENTLY 2021-03-25 18:00:28 -03:00
snapshot.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
sortsupport.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
spccache.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
syscache.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
timeout.h Add idle_session_timeout. 2021-01-06 18:28:52 -05:00
timestamp.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
tuplesort.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
tuplestore.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
typcache.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
tzparser.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
uuid.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
varbit.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
varlena.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
xid8.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
xml.h Update copyright for 2021 2021-01-02 13:06:25 -05:00