Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit31eae60

Browse files
committed
Allow CURRENT/SESSION_USER to be used in certain commands
Commands such as ALTER USER, ALTER GROUP, ALTER ROLE, GRANT, and thevarious ALTER OBJECT / OWNER TO, as well as ad-hoc clauses related toroles such as the AUTHORIZATION clause of CREATE SCHEMA, the FOR clauseof CREATE USER MAPPING, and the FOR ROLE clause of ALTER DEFAULTPRIVILEGES can now take the keywords CURRENT_USER and SESSION_USER asuser 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 failto work in presence of a role named "current_user".The special role specifiers PUBLIC and NONE also have more consistenthandling 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.
1 parentfa83f80 commit31eae60

File tree

52 files changed

+2000
-347
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+2000
-347
lines changed

‎doc/src/sgml/ref/alter_aggregate.sgml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ PostgreSQL documentation
2222
<refsynopsisdiv>
2323
<synopsis>
2424
ALTER AGGREGATE <replaceable>name</replaceable> ( <replaceable>aggregate_signature</replaceable> ) RENAME TO <replaceable>new_name</replaceable>
25-
ALTER AGGREGATE <replaceable>name</replaceable> ( <replaceable>aggregate_signature</replaceable> ) OWNER TO <replaceable>new_owner</replaceable>
25+
ALTER AGGREGATE <replaceable>name</replaceable> ( <replaceable>aggregate_signature</replaceable> )
26+
OWNER TO { <replaceable>new_owner</replaceable> | CURRENT_USER | SESSION_USER }
2627
ALTER AGGREGATE <replaceable>name</replaceable> ( <replaceable>aggregate_signature</replaceable> ) SET SCHEMA <replaceable>new_schema</replaceable>
2728

2829
<phrase>where <replaceable>aggregate_signature</replaceable> is:</phrase>

‎doc/src/sgml/ref/alter_collation.sgml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ PostgreSQL documentation
2222
<refsynopsisdiv>
2323
<synopsis>
2424
ALTER COLLATION <replaceable>name</replaceable> RENAME TO <replaceable>new_name</replaceable>
25-
ALTER COLLATION <replaceable>name</replaceable> OWNER TO <replaceable>new_owner</replaceable>
25+
ALTER COLLATION <replaceable>name</replaceable> OWNER TO{<replaceable>new_owner</replaceable> | CURRENT_USER | SESSION_USER }
2626
ALTER COLLATION <replaceable>name</replaceable> SET SCHEMA <replaceable>new_schema</replaceable>
2727
</synopsis>
2828
</refsynopsisdiv>

‎doc/src/sgml/ref/alter_conversion.sgml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ PostgreSQL documentation
2222
<refsynopsisdiv>
2323
<synopsis>
2424
ALTER CONVERSION <replaceable>name</replaceable> RENAME TO <replaceable>new_name</replaceable>
25-
ALTER CONVERSION <replaceable>name</replaceable> OWNER TO <replaceable>new_owner</replaceable>
25+
ALTER CONVERSION <replaceable>name</replaceable> OWNER TO{<replaceable>new_owner</replaceable> | CURRENT_USER | SESSION_USER }
2626
ALTER CONVERSION <replaceable>name</replaceable> SET SCHEMA <replaceable>new_schema</replaceable>
2727
</synopsis>
2828
</refsynopsisdiv>

‎doc/src/sgml/ref/alter_database.sgml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ ALTER DATABASE <replaceable class="PARAMETER">name</replaceable> [ [ WITH ] <rep
3131

3232
ALTER DATABASE <replaceable class="PARAMETER">name</replaceable> RENAME TO <replaceable>new_name</replaceable>
3333

34-
ALTER DATABASE <replaceable class="PARAMETER">name</replaceable> OWNER TO <replaceable>new_owner</replaceable>
34+
ALTER DATABASE <replaceable class="PARAMETER">name</replaceable> OWNER TO{<replaceable>new_owner</replaceable> | CURRENT_USER | SESSION_USER }
3535

3636
ALTER DATABASE <replaceable class="PARAMETER">name</replaceable> SET TABLESPACE <replaceable class="PARAMETER">new_tablespace</replaceable>
3737

‎doc/src/sgml/ref/alter_domain.sgml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ ALTER DOMAIN <replaceable class="PARAMETER">name</replaceable>
3636
ALTER DOMAIN <replaceable class="PARAMETER">name</replaceable>
3737
VALIDATE CONSTRAINT <replaceable class="PARAMETER">constraint_name</replaceable>
3838
ALTER DOMAIN <replaceable class="PARAMETER">name</replaceable>
39-
OWNER TO <replaceable class="PARAMETER">new_owner</replaceable>
39+
OWNER TO{<replaceable class="PARAMETER">new_owner</replaceable> | CURRENT_USER | SESSION_USER }
4040
ALTER DOMAIN <replaceable class="PARAMETER">name</replaceable>
4141
RENAME TO <replaceable class="PARAMETER">new_name</replaceable>
4242
ALTER DOMAIN <replaceable class="PARAMETER">name</replaceable>

‎doc/src/sgml/ref/alter_event_trigger.sgml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ PostgreSQL documentation
2323
<synopsis>
2424
ALTER EVENT TRIGGER <replaceable class="PARAMETER">name</replaceable> DISABLE
2525
ALTER EVENT TRIGGER <replaceable class="PARAMETER">name</replaceable> ENABLE [ REPLICA | ALWAYS ]
26-
ALTER EVENT TRIGGER <replaceable class="PARAMETER">name</replaceable> OWNER TO <replaceable class="PARAMETER">new_owner</replaceable>
26+
ALTER EVENT TRIGGER <replaceable class="PARAMETER">name</replaceable> OWNER TO{<replaceable class="PARAMETER">new_owner</replaceable> | CURRENT_USER | SESSION_USER }
2727
ALTER EVENT TRIGGER <replaceable class="PARAMETER">name</replaceable> RENAME TO <replaceable class="PARAMETER">new_name</replaceable>
2828
</synopsis>
2929
</refsynopsisdiv>

‎doc/src/sgml/ref/alter_foreign_data_wrapper.sgml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ ALTER FOREIGN DATA WRAPPER <replaceable class="parameter">name</replaceable>
2525
[ HANDLER <replaceable class="parameter">handler_function</replaceable> | NO HANDLER ]
2626
[ VALIDATOR <replaceable class="parameter">validator_function</replaceable> | NO VALIDATOR ]
2727
[ OPTIONS ( [ ADD | SET | DROP ] <replaceable class="PARAMETER">option</replaceable> ['<replaceable class="PARAMETER">value</replaceable>'] [, ... ]) ]
28-
ALTER FOREIGN DATA WRAPPER <replaceable class="parameter">name</replaceable> OWNER TO <replaceable>new_owner</replaceable>
28+
ALTER FOREIGN DATA WRAPPER <replaceable class="parameter">name</replaceable> OWNER TO{<replaceable>new_owner</replaceable> | CURRENT_USER | SESSION_USER }
2929
ALTER FOREIGN DATA WRAPPER <replaceable class="parameter">name</replaceable> RENAME TO <replaceable>new_name</replaceable>
3030
</synopsis>
3131
</refsynopsisdiv>

‎doc/src/sgml/ref/alter_foreign_table.sgml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ ALTER FOREIGN TABLE [ IF EXISTS ] <replaceable class="PARAMETER">name</replaceab
4848
ENABLE TRIGGER [ <replaceable class="PARAMETER">trigger_name</replaceable> | ALL | USER ]
4949
ENABLE REPLICA TRIGGER <replaceable class="PARAMETER">trigger_name</replaceable>
5050
ENABLE ALWAYS TRIGGER <replaceable class="PARAMETER">trigger_name</replaceable>
51-
OWNER TO <replaceable class="PARAMETER">new_owner</replaceable>
51+
OWNER TO{<replaceable class="PARAMETER">new_owner</replaceable> | CURRENT_USER | SESSION_USER }
5252
OPTIONS ( [ ADD | SET | DROP ] <replaceable class="PARAMETER">option</replaceable> ['<replaceable class="PARAMETER">value</replaceable>'] [, ... ])
5353
</synopsis>
5454
</refsynopsisdiv>

‎doc/src/sgml/ref/alter_function.sgml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ ALTER FUNCTION <replaceable>name</replaceable> ( [ [ <replaceable class="paramet
2626
ALTER FUNCTION <replaceable>name</replaceable> ( [ [ <replaceable class="parameter">argmode</replaceable> ] [ <replaceable class="parameter">argname</replaceable> ] <replaceable class="parameter">argtype</replaceable> [, ...] ] )
2727
RENAME TO <replaceable>new_name</replaceable>
2828
ALTER FUNCTION <replaceable>name</replaceable> ( [ [ <replaceable class="parameter">argmode</replaceable> ] [ <replaceable class="parameter">argname</replaceable> ] <replaceable class="parameter">argtype</replaceable> [, ...] ] )
29-
OWNER TO <replaceable>new_owner</replaceable>
29+
OWNER TO{<replaceable>new_owner</replaceable> | CURRENT_USER | SESSION_USER }
3030
ALTER FUNCTION <replaceable>name</replaceable> ( [ [ <replaceable class="parameter">argmode</replaceable> ] [ <replaceable class="parameter">argname</replaceable> ] <replaceable class="parameter">argtype</replaceable> [, ...] ] )
3131
SET SCHEMA <replaceable>new_schema</replaceable>
3232

‎doc/src/sgml/ref/alter_group.sgml‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,14 @@ PostgreSQL documentation
2121

2222
<refsynopsisdiv>
2323
<synopsis>
24-
ALTER GROUP <replaceable class="PARAMETER">group_name</replaceable> ADD USER <replaceable class="PARAMETER">user_name</replaceable> [, ... ]
25-
ALTER GROUP <replaceable class="PARAMETER">group_name</replaceable> DROP USER <replaceable class="PARAMETER">user_name</replaceable> [, ... ]
24+
ALTER GROUP <replaceable class="PARAMETER">role_specification</replaceable> ADD USER <replaceable class="PARAMETER">user_name</replaceable> [, ... ]
25+
ALTER GROUP <replaceable class="PARAMETER">role_specification</replaceable> DROP USER <replaceable class="PARAMETER">user_name</replaceable> [, ... ]
26+
27+
<phrase>where <replaceable class="PARAMETER">role_specification</replaceable> can be:</phrase>
28+
29+
<replaceable class="PARAMETER">role_name</replaceable>
30+
| CURRENT_USER
31+
| SESSION_USER
2632

2733
ALTER GROUP <replaceable class="PARAMETER">group_name</replaceable> RENAME TO <replaceable>new_name</replaceable>
2834
</synopsis>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp