mirror of
				https://github.com/postgres/postgres.git
				synced 2025-11-03 09:13:20 +03:00 
			
		
		
		
	Document current_role.
This system function has been there a very long time, but somehow escaped being listed in func.sgml. Fabien Coelho and Tom Lane Discussion: https://postgr.es/m/alpine.DEB.2.20.1705061027580.3896@lancre
This commit is contained in:
		@@ -13440,6 +13440,12 @@ postgres=# SELECT * FROM unnest2(ARRAY[[1,2],[3,4]]);
 | 
				
			|||||||
       by the client (might contain more than one statement)</entry>
 | 
					       by the client (might contain more than one statement)</entry>
 | 
				
			||||||
      </row>
 | 
					      </row>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      <row>
 | 
				
			||||||
 | 
					       <entry><literal><function>current_role</function></literal></entry>
 | 
				
			||||||
 | 
					       <entry><type>name</type></entry>
 | 
				
			||||||
 | 
					       <entry>equivalent to <function>current_user</function></entry>
 | 
				
			||||||
 | 
					      </row>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      <row>
 | 
					      <row>
 | 
				
			||||||
       <entry><literal><function>current_schema</function>[()]</literal></entry>
 | 
					       <entry><literal><function>current_schema</function>[()]</literal></entry>
 | 
				
			||||||
       <entry><type>name</type></entry>
 | 
					       <entry><type>name</type></entry>
 | 
				
			||||||
@@ -13551,8 +13557,11 @@ postgres=# SELECT * FROM unnest2(ARRAY[[1,2],[3,4]]);
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
   <note>
 | 
					   <note>
 | 
				
			||||||
    <para>
 | 
					    <para>
 | 
				
			||||||
     <function>current_catalog</function>, <function>current_schema</function>,
 | 
					     <function>current_catalog</function>,
 | 
				
			||||||
     <function>current_user</function>, <function>session_user</function>,
 | 
					     <function>current_role</function>,
 | 
				
			||||||
 | 
					     <function>current_schema</function>,
 | 
				
			||||||
 | 
					     <function>current_user</function>,
 | 
				
			||||||
 | 
					     <function>session_user</function>,
 | 
				
			||||||
     and <function>user</function> have special syntactic status
 | 
					     and <function>user</function> have special syntactic status
 | 
				
			||||||
     in <acronym>SQL</acronym>: they must be called without trailing
 | 
					     in <acronym>SQL</acronym>: they must be called without trailing
 | 
				
			||||||
     parentheses.  (In PostgreSQL, parentheses can optionally be used with
 | 
					     parentheses.  (In PostgreSQL, parentheses can optionally be used with
 | 
				
			||||||
@@ -13572,6 +13581,10 @@ postgres=# SELECT * FROM unnest2(ARRAY[[1,2],[3,4]]);
 | 
				
			|||||||
    <primary>current_query</primary>
 | 
					    <primary>current_query</primary>
 | 
				
			||||||
   </indexterm>
 | 
					   </indexterm>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					   <indexterm>
 | 
				
			||||||
 | 
					    <primary>current_role</primary>
 | 
				
			||||||
 | 
					   </indexterm>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
   <indexterm>
 | 
					   <indexterm>
 | 
				
			||||||
    <primary>current_schema</primary>
 | 
					    <primary>current_schema</primary>
 | 
				
			||||||
   </indexterm>
 | 
					   </indexterm>
 | 
				
			||||||
@@ -13623,6 +13636,11 @@ postgres=# SELECT * FROM unnest2(ARRAY[[1,2],[3,4]]);
 | 
				
			|||||||
    functions with the attribute <literal>SECURITY DEFINER</literal>.
 | 
					    functions with the attribute <literal>SECURITY DEFINER</literal>.
 | 
				
			||||||
    In Unix parlance, the session user is the <quote>real user</quote> and
 | 
					    In Unix parlance, the session user is the <quote>real user</quote> and
 | 
				
			||||||
    the current user is the <quote>effective user</quote>.
 | 
					    the current user is the <quote>effective user</quote>.
 | 
				
			||||||
 | 
					    <function>current_role</function> and <function>user</function> are
 | 
				
			||||||
 | 
					    synonyms for <function>current_user</function>.  (The SQL standard draws
 | 
				
			||||||
 | 
					    a distinction between <function>current_role</function>
 | 
				
			||||||
 | 
					    and <function>current_user</function>, but <productname>PostgreSQL</>
 | 
				
			||||||
 | 
					    does not, since it unifies users and roles into a single kind of entity.)
 | 
				
			||||||
   </para>
 | 
					   </para>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
   <para>
 | 
					   <para>
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user