postgresql/src/include/utils
Alvaro Herrera 31eae6028e Allow CURRENT/SESSION_USER to be used in certain commands
Commands such as ALTER USER, ALTER GROUP, ALTER ROLE, GRANT, and the
various ALTER OBJECT / OWNER TO, as well as ad-hoc clauses related to
roles such as the AUTHORIZATION clause of CREATE SCHEMA, the FOR clause
of CREATE USER MAPPING, and the FOR ROLE clause of ALTER DEFAULT
PRIVILEGES can now take the keywords CURRENT_USER and SESSION_USER as
user specifiers in place of an explicit user name.

This commit also fixes some quite ugly handling of special standards-
mandated syntax in CREATE USER MAPPING, which in particular would fail
to work in presence of a role named "current_user".

The special role specifiers PUBLIC and NONE also have more consistent
handling now.

Also take the opportunity to add location tracking to user specifiers.

Authors: Kyotaro Horiguchi.  Heavily reworked by Álvaro Herrera.
Reviewed by: Rushabh Lathia, Adam Brightwell, Marti Raudsepp.
2015-03-09 15:41:54 -03:00
..
.gitignore Avoid maintaining three separate copies of the error codes list. 2011-02-03 22:32:49 -05:00
acl.h Allow CURRENT/SESSION_USER to be used in certain commands 2015-03-09 15:41:54 -03:00
array.h In array_agg(), don't create a new context for every group. 2015-02-21 17:24:48 -08:00
ascii.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
attoptcache.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
builtins.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
bytea.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
cash.h Add casts from int4 and int8 to numeric. 2011-04-05 09:35:43 -04:00
catcache.h Use FLEXIBLE_ARRAY_MEMBER in a bunch more places. 2015-02-20 00:11:42 -05:00
combocid.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
date.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
datetime.h Use FLEXIBLE_ARRAY_MEMBER in a bunch more places. 2015-02-20 00:11:42 -05:00
datum.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
dynahash.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
dynamic_loader.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
elog.h Add a note to PG_TRY's documentation about volatile safety. 2015-01-26 15:53:37 -05:00
evtcache.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
fmgrtab.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
formatting.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
geo_decls.h Use FLEXIBLE_ARRAY_MEMBER in a bunch more places. 2015-02-20 00:11:42 -05:00
guc_tables.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
guc.h Replace checkpoint_segments with min_wal_size and max_wal_size. 2015-02-23 18:53:02 +02:00
help_config.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
hsearch.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
inet.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
int8.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
inval.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
json.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
jsonapi.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
jsonb.h Use FLEXIBLE_ARRAY_MEMBER in a bunch more places. 2015-02-20 00:11:42 -05:00
lockwaitpolicy.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
logtape.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
lsyscache.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
memdebug.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
memutils.h Move memory context callback declarations into palloc.h. 2015-03-01 12:31:32 -05:00
nabstime.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
numeric.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
palloc.h Move memory context callback declarations into palloc.h. 2015-03-01 12:31:32 -05:00
pg_locale.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
pg_lsn.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
pg_rusage.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
plancache.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
portal.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
ps_status.h
rangetypes.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
rel.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
relcache.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
relfilenodemap.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
relmapper.h Use FLEXIBLE_ARRAY_MEMBER in a bunch more places. 2015-02-20 00:11:42 -05:00
reltrigger.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
resowner_private.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
resowner.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
rls.h Fix column-privilege leak in error-message paths 2015-01-28 12:31:30 -05:00
ruleutils.h Improve performance of EXPLAIN with large range tables. 2015-01-15 13:18:12 -05:00
selfuncs.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
snapmgr.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
snapshot.h Advance backend's advertised xmin more aggressively. 2015-01-17 01:15:23 +02:00
sortsupport.h Fix typos, update README. 2015-01-23 15:06:53 -05:00
spccache.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
syscache.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
timeout.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
timestamp.h Add transform functions for AT TIME ZONE. 2015-03-01 13:22:34 -05:00
tqual.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
tuplesort.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
tuplestore.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
typcache.h Use the typcache to cache constraints for domain types. 2015-03-01 14:06:55 -05:00
tzparser.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
uuid.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
varbit.h Use FLEXIBLE_ARRAY_MEMBER in a bunch more places. 2015-02-20 00:11:42 -05:00
xml.h Update copyright for 2015 2015-01-06 11:43:47 -05:00