postgresql/src/include/utils
Stephen Frost 20064c0ec2 Handle ALTER EXTENSION ADD/DROP with pg_init_privs
In commit 6c268df, pg_init_privs was added to track the initial
privileges of catalog objects and extensions.  Unfortunately, that
commit didn't include understanding of ALTER EXTENSION ADD/DROP, which
allows the objects associated with an extension to be changed after the
initial CREATE EXTENSION script has been run.

The result of this meant that ACLs for objects added through
ALTER EXTENSION ADD were not recorded into pg_init_privs and we would
end up including those ACLs in pg_dump when we shouldn't have.

This commit corrects that by making sure to have pg_init_privs updated
when ALTER EXTENSION ADD/DROP is run, recording the permissions as they
are at ALTER EXTENSION ADD time, and removing any if/when ALTER
EXTENSION DROP is called.

This issue was pointed out by Moshe Jacobson as commentary on bug #14456
(which was actually a bug about versions prior to 9.6 not handling
custom ACLs on extensions correctly, an issue now addressed with
pg_init_privs in 9.6).

Back-patch to 9.6 where pg_init_privs was introduced.
2017-01-29 23:05:09 -05:00
..
.gitignore Avoid maintaining three separate copies of the error codes list. 2011-02-03 22:32:49 -05:00
acl.h Handle ALTER EXTENSION ADD/DROP with pg_init_privs 2017-01-29 23:05:09 -05:00
aclchk_internal.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
array.h In plpgsql, don't try to convert int2vector or oidvector to expanded array. 2016-08-18 14:48:51 -04:00
arrayaccess.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
ascii.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
attoptcache.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
builtins.h Add SQL-accessible functions for inspecting index AM properties. 2016-08-13 18:31:14 -04:00
bytea.h Extend sortsupport for text to more opclasses. 2016-02-03 14:29:53 -05:00
cash.h Add casts from int4 and int8 to numeric. 2011-04-05 09:35:43 -04:00
catcache.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
combocid.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
date.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
datetime.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
datum.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
dynahash.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
dynamic_loader.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
elog.h Improve unreachability recognition in elog() macro. 2016-09-10 17:54:23 -04:00
evtcache.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
expandeddatum.h Inline the easy cases in MakeExpandedObjectReadOnly(). 2016-06-03 18:34:05 -04:00
fmgrtab.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
formatting.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
geo_decls.h pgindent run for 9.6 2016-06-09 18:02:36 -04:00
guc.h Show a sensible value in pg_settings.unit for GUC_UNIT_XSEGS variables. 2016-10-03 16:40:26 -04:00
guc_tables.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
help_config.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
hsearch.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
index_selfuncs.h Restructure index access method API to hide most of it at the C level. 2016-01-17 19:36:59 -05:00
inet.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
int8.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
inval.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
json.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
jsonapi.h pgindent run for 9.6 2016-06-09 18:02:36 -04:00
jsonb.h pgindent run for 9.6 2016-06-09 18:02:36 -04:00
logtape.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
lsyscache.h Improve index AMs' opclass validation procedures. 2016-01-21 19:47:15 -05:00
memdebug.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
memutils.h Add macros to make AllocSetContextCreate() calls simpler and safer. 2016-08-27 17:50:38 -04:00
nabstime.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
numeric.h Remove bogus dependencies on NUMERIC_MAX_PRECISION. 2016-08-14 15:06:01 -04:00
palloc.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pg_crc.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pg_locale.h Cope if platform declares mbstowcs_l(), but not locale_t, in <xlocale.h>. 2016-03-15 13:19:57 -04:00
pg_lsn.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pg_rusage.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
plancache.h Avoid invalidating all foreign-join cached plans when user mappings change. 2016-07-15 17:23:02 -04:00
portal.h Fix TOAST access failure in RETURNING queries. 2016-08-07 17:46:08 -04:00
ps_status.h Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
rangetypes.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
rel.h Re-allow user_catalog_table option for materialized views. 2016-11-10 15:00:58 -05:00
relcache.h Restore foreign-key-aware estimation of join relation sizes. 2016-06-18 15:22:34 -04:00
relfilenodemap.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
relmapper.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
reltrigger.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
resowner.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
resowner_private.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
rls.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
ruleutils.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
sampling.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
selfuncs.h Support CREATE ACCESS METHOD 2016-03-23 23:01:35 -03:00
snapmgr.h Account for catalog snapshot in PGXACT->xmin updates. 2016-11-15 15:55:35 -05:00
snapshot.h Add the "snapshot too old" feature 2016-04-08 14:36:30 -05:00
sortsupport.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
spccache.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
syscache.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
timeout.h Be more predictable about reporting "lock timeout" vs "statement timeout". 2016-05-27 10:40:20 -04:00
timestamp.h Add parallel query support functions for assorted aggregates. 2016-04-05 14:32:53 -04:00
tqual.h Fix copy-and-pasteo in 81c766b3fd. 2016-08-05 16:21:38 -04:00
tuplesort.h Reuse abbreviated keys in ordered [set] aggregates. 2016-02-17 15:40:00 +05:30
tuplestore.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
typcache.h Fix handling of expanded objects in CoerceToDomain and CASE execution. 2016-12-22 15:01:38 -05:00
tzparser.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
uuid.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
varbit.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
xml.h Update copyright for 2016 2016-01-02 13:33:40 -05:00