User Tools

Site Tools


resources

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
resources [2011/11/15 15:40]
k2patel [Admin SQL]
resources [2011/11/15 15:43]
k2patel [Getting Connection Information]
Line 78: Line 78:
 Following is the available procedures / variable. Following is the available procedures / variable.
  
- +Name 
-{| style="​border-spacing:​0;"​ +Return Type 
-! <​center>​Name</​center>​ +Description 
-! <​center>​Return Type</​center>​ +current_catalog 
-! <​center>​Description</​center>​ +name 
- +name of current database (called "​catalog"​ in the SQL standard) 
-|- +current_database() 
-| style="​background-color:#​ffffff;​border-top:​none;​border-bottom:​0.0361in double #​808080;​border-left:​0.0361in double #​808080;​border-right:​none;​padding:​0.0194in;"​| <tt>current_catalog</tt> +name 
-| style="​background-color:#​ffffff;​border-top:​none;​border-bottom:​0.0361in double #​808080;​border-left:​0.0361in double #​808080;​border-right:​none;​padding:​0.0194in;"​| <tt>name</tt> +name of current database 
-| style="​background-color:#​ffffff;​border-top:​none;​border-bottom:​0.0361in double #​808080;​border-left:​0.0361in double #​808080;​border-right:​0.0361in double #​808080;​padding:​0.0194in;"​| ​name of current database (called&​nbsp;​"​catalog"​&nbsp;in the SQL standard) +current_schema[()] 
- +name 
-|- +name of current schema 
-| style="​background-color:#​ffffff;​border-top:​none;​border-bottom:​0.0361in double #​808080;​border-left:​0.0361in double #​808080;​border-right:​none;​padding:​0.0194in;"​| <tt>current_database()</tt> +current_schemas(boolean) 
-| style="​background-color:#​ffffff;​border-top:​none;​border-bottom:​0.0361in double #​808080;​border-left:​0.0361in double #​808080;​border-right:​none;​padding:​0.0194in;"​| <tt>name</tt> +name[] 
-| style="​background-color:#​ffffff;​border-top:​none;​border-bottom:​0.0361in double #​808080;​border-left:​0.0361in double #​808080;​border-right:​0.0361in double #​808080;​padding:​0.0194in;"​| ​name of current database +names of schemas in search path, optionally including implicit schemas 
- +current_user 
-|- +name 
-| style="​background-color:#​ffffff;​border-top:​none;​border-bottom:​0.0361in double #​808080;​border-left:​0.0361in double #​808080;​border-right:​none;​padding:​0.0194in;"​| <tt>current_schema<​nowiki>​[()]</​nowiki></​tt>​ +user name of current execution context 
-| style="​background-color:#​ffffff;​border-top:​none;​border-bottom:​0.0361in double #​808080;​border-left:​0.0361in double #​808080;​border-right:​none;​padding:​0.0194in;"​| <tt>name</tt> +current_query() 
-| style="​background-color:#​ffffff;​border-top:​none;​border-bottom:​0.0361in double #​808080;​border-left:​0.0361in double #​808080;​border-right:​0.0361in double #​808080;​padding:​0.0194in;"​| ​name of current schema +text 
- +text of the currently executing query, as submitted by the client (might contain more than one statement) 
-|- +pg_backend_pid() 
-| style="​background-color:#​ffffff;​border-top:​none;​border-bottom:​0.0361in double #​808080;​border-left:​0.0361in double #​808080;​border-right:​none;​padding:​0.0194in;"​| <tt>current_schemas(boolean)</tt> +int 
-| style="​background-color:#​ffffff;​border-top:​none;​border-bottom:​0.0361in double #​808080;​border-left:​0.0361in double #​808080;​border-right:​none;​padding:​0.0194in;"​| <​tt><​nowiki>​name[]</​nowiki></​tt>​ +Process ID of the server process attached to the current session 
-| style="​background-color:#​ffffff;​border-top:​none;​border-bottom:​0.0361in double #​808080;​border-left:​0.0361in double #​808080;​border-right:​0.0361in double #​808080;​padding:​0.0194in;"​| ​names of schemas in search path, optionally including implicit schemas +pg_listening_channels() 
- +setof text 
-|- +channel names that the session is currently listening on 
-| style="​background-color:#​ffffff;​border-top:​none;​border-bottom:​0.0361in double #​808080;​border-left:​0.0361in double #​808080;​border-right:​none;​padding:​0.0194in;"​| <tt>current_user</tt> +inet_client_addr() 
-| style="​background-color:#​ffffff;​border-top:​none;​border-bottom:​0.0361in double #​808080;​border-left:​0.0361in double #​808080;​border-right:​none;​padding:​0.0194in;"​| <tt>name</tt> +inet 
-| style="​background-color:#​ffffff;​border-top:​none;​border-bottom:​0.0361in double #​808080;​border-left:​0.0361in double #​808080;​border-right:​0.0361in double #​808080;​padding:​0.0194in;"​| ​user name of current execution context +address of the remote connection 
- +inet_client_port() 
-|- +int 
-| style="​background-color:#​ffffff;​border-top:​none;​border-bottom:​0.0361in double #​808080;​border-left:​0.0361in double #​808080;​border-right:​none;​padding:​0.0194in;"​| <tt>current_query()</tt> +port of the remote connection 
-| style="​background-color:#​ffffff;​border-top:​none;​border-bottom:​0.0361in double #​808080;​border-left:​0.0361in double #​808080;​border-right:​none;​padding:​0.0194in;"​| <tt>text</tt> +inet_server_addr() 
-| style="​background-color:#​ffffff;​border-top:​none;​border-bottom:​0.0361in double #​808080;​border-left:​0.0361in double #​808080;​border-right:​0.0361in double #​808080;​padding:​0.0194in;"​| ​text of the currently executing query, as submitted by the client (might contain more than one statement) +inet 
- +address of the local connection 
-|- +inet_server_port() 
-| style="​background-color:#​ffffff;​border-top:​none;​border-bottom:​0.0361in double #​808080;​border-left:​0.0361in double #​808080;​border-right:​none;​padding:​0.0194in;"​| <tt>pg_backend_pid()</tt> +int 
-| style="​background-color:#​ffffff;​border-top:​none;​border-bottom:​0.0361in double #​808080;​border-left:​0.0361in double #​808080;​border-right:​none;​padding:​0.0194in;"​| <tt>int</tt> +port of the local connection 
-| style="​background-color:#​ffffff;​border-top:​none;​border-bottom:​0.0361in double #​808080;​border-left:​0.0361in double #​808080;​border-right:​0.0361in double #​808080;​padding:​0.0194in;"​| ​Process ID of the server process attached to the current session +pg_my_temp_schema() 
- +oid 
-|- +OID of session'​s temporary schema, or 0 if none 
-| style="​background-color:#​ffffff;​border-top:​none;​border-bottom:​0.0361in double #​808080;​border-left:​0.0361in double #​808080;​border-right:​none;​padding:​0.0194in;"​| <tt>pg_listening_channels()</tt> +pg_is_other_temp_schema(oid) 
-| style="​background-color:#​ffffff;​border-top:​none;​border-bottom:​0.0361in double #​808080;​border-left:​0.0361in double #​808080;​border-right:​none;​padding:​0.0194in;"​| <tt>setof text</tt> +boolean 
-| style="​background-color:#​ffffff;​border-top:​none;​border-bottom:​0.0361in double #​808080;​border-left:​0.0361in double #​808080;​border-right:​0.0361in double #​808080;​padding:​0.0194in;"​| ​channel names that the session is currently listening on +is schema another session'​s temporary schema? 
- +pg_postmaster_start_time() 
-|- +timestamp with time zone 
-| style="​background-color:#​ffffff;​border-top:​none;​border-bottom:​0.0361in double #​808080;​border-left:​0.0361in double #​808080;​border-right:​none;​padding:​0.0194in;"​| <tt>inet_client_addr()</tt> +server start time 
-| style="​background-color:#​ffffff;​border-top:​none;​border-bottom:​0.0361in double #​808080;​border-left:​0.0361in double #​808080;​border-right:​none;​padding:​0.0194in;"​| <tt>inet</tt> +pg_conf_load_time() 
-| style="​background-color:#​ffffff;​border-top:​none;​border-bottom:​0.0361in double #​808080;​border-left:​0.0361in double #​808080;​border-right:​0.0361in double #​808080;​padding:​0.0194in;"​| ​address of the remote connection +timestamp with time zone 
- +configuration load time 
-|- +session_user 
-| style="​background-color:#​ffffff;​border-top:​none;​border-bottom:​0.0361in double #​808080;​border-left:​0.0361in double #​808080;​border-right:​none;​padding:​0.0194in;"​| <tt>inet_client_port()</tt> +name 
-| style="​background-color:#​ffffff;​border-top:​none;​border-bottom:​0.0361in double #​808080;​border-left:​0.0361in double #​808080;​border-right:​none;​padding:​0.0194in;"​| <tt>int</tt> +session user name 
-| style="​background-color:#​ffffff;​border-top:​none;​border-bottom:​0.0361in double #​808080;​border-left:​0.0361in double #​808080;​border-right:​0.0361in double #​808080;​padding:​0.0194in;"​| ​port of the remote connection +user 
- +name 
-|- +equivalent ​to current_user 
-| style="​background-color:#​ffffff;​border-top:​none;​border-bottom:​0.0361in double #​808080;​border-left:​0.0361in double #​808080;​border-right:​none;​padding:​0.0194in;"​| <tt>inet_server_addr()</tt> +version() 
-| style="​background-color:#​ffffff;​border-top:​none;​border-bottom:​0.0361in double #​808080;​border-left:​0.0361in double #​808080;​border-right:​none;​padding:​0.0194in;"​| <tt>inet</tt> +text 
-| style="​background-color:#​ffffff;​border-top:​none;​border-bottom:​0.0361in double #​808080;​border-left:​0.0361in double #​808080;​border-right:​0.0361in double #​808080;​padding:​0.0194in;"​| ​address of the local connection +PostgreSQL version ​information
- +
-|- +
-| style="​background-color:#​efefef;​border-top:​none;​border-bottom:​0.0361in double #​808080;​border-left:​0.0361in double #​808080;​border-right:​none;​padding:​0.0194in;"​| <tt>inet_server_port()</tt> +
-| style="​background-color:#​efefef;​border-top:​none;​border-bottom:​0.0361in double #​808080;​border-left:​0.0361in double #​808080;​border-right:​none;​padding:​0.0194in;"​| <tt>int</tt> +
-| style="​background-color:#​efefef;​border-top:​none;​border-bottom:​0.0361in double #​808080;​border-left:​0.0361in double #​808080;​border-right:​0.0361in double #​808080;​padding:​0.0194in;"​| ​port of the local connection +
- +
-|- +
-| style="​background-color:#​ffffff;​border-top:​none;​border-bottom:​0.0361in double #​808080;​border-left:​0.0361in double #​808080;​border-right:​none;​padding:​0.0194in;"​| <tt>pg_my_temp_schema()</tt> +
-| style="​background-color:#​ffffff;​border-top:​none;​border-bottom:​0.0361in double #​808080;​border-left:​0.0361in double #​808080;​border-right:​none;​padding:​0.0194in;"​| <tt>oid</tt> +
-| style="​background-color:#​ffffff;​border-top:​none;​border-bottom:​0.0361in double #​808080;​border-left:​0.0361in double #​808080;​border-right:​0.0361in double #​808080;​padding:​0.0194in;"​| ​OID of session'​s temporary schema, or 0 if none +
- +
-|- +
-| style="​background-color:#​ffffff;​border-top:​none;​border-bottom:​0.0361in double #​808080;​border-left:​0.0361in double #​808080;​border-right:​none;​padding:​0.0194in;"​| <tt>pg_is_other_temp_schema(oid)</tt> +
-| style="​background-color:#​ffffff;​border-top:​none;​border-bottom:​0.0361in double #​808080;​border-left:​0.0361in double #​808080;​border-right:​none;​padding:​0.0194in;"​| <tt>boolean</tt> +
-| style="​background-color:#​ffffff;​border-top:​none;​border-bottom:​0.0361in double #​808080;​border-left:​0.0361in double #​808080;​border-right:​0.0361in double #​808080;​padding:​0.0194in;"​| ​is schema another session'​s temporary schema? +
- +
-|- +
-| style="​background-color:#​ffffff;​border-top:​none;​border-bottom:​0.0361in double #​808080;​border-left:​0.0361in double #​808080;​border-right:​none;​padding:​0.0194in;"​| <tt>pg_postmaster_start_time()</tt> +
-| style="​background-color:#​ffffff;​border-top:​none;​border-bottom:​0.0361in double #​808080;​border-left:​0.0361in double #​808080;​border-right:​none;​padding:​0.0194in;"​| <tt>timestamp with time zone</tt> +
-| style="​background-color:#​ffffff;​border-top:​none;​border-bottom:​0.0361in double #​808080;​border-left:​0.0361in double #​808080;​border-right:​0.0361in double #​808080;​padding:​0.0194in;"​| ​server start time +
- +
-|- +
-| style="​background-color:#​ffffff;​border-top:​none;​border-bottom:​0.0361in double #​808080;​border-left:​0.0361in double #​808080;​border-right:​none;​padding:​0.0194in;"​| <tt>pg_conf_load_time()</tt> +
-| style="​background-color:#​ffffff;​border-top:​none;​border-bottom:​0.0361in double #​808080;​border-left:​0.0361in double #​808080;​border-right:​none;​padding:​0.0194in;"​| <tt>timestamp with time zone</tt> +
-| style="​background-color:#​ffffff;​border-top:​none;​border-bottom:​0.0361in double #​808080;​border-left:​0.0361in double #​808080;​border-right:​0.0361in double #​808080;​padding:​0.0194in;"​| ​configuration load time +
- +
-|- +
-| style="​background-color:#​ffffff;​border-top:​none;​border-bottom:​0.0361in double #​808080;​border-left:​0.0361in double #​808080;​border-right:​none;​padding:​0.0194in;"​| <tt>session_user</tt> +
-| style="​background-color:#​ffffff;​border-top:​none;​border-bottom:​0.0361in double #​808080;​border-left:​0.0361in double #​808080;​border-right:​none;​padding:​0.0194in;"​| <tt>name</tt> +
-| style="​background-color:#​ffffff;​border-top:​none;​border-bottom:​0.0361in double #​808080;​border-left:​0.0361in double #​808080;​border-right:​0.0361in double #​808080;​padding:​0.0194in;"​| ​session user name +
- +
-|- +
-| style="​background-color:#​ffffff;​border-top:​none;​border-bottom:​0.0361in double #​808080;​border-left:​0.0361in double #​808080;​border-right:​none;​padding:​0.0194in;"​| <tt>user</tt> +
-| style="​background-color:#​ffffff;​border-top:​none;​border-bottom:​0.0361in double #​808080;​border-left:​0.0361in double #​808080;​border-right:​none;​padding:​0.0194in;"​| <tt>name</tt> +
-| style="​background-color:#​ffffff;​border-top:​none;​border-bottom:​0.0361in double #​808080;​border-left:​0.0361in double #​808080;​border-right:​0.0361in double #​808080;​padding:​0.0194in;"​| ​equivalent ​to&​nbsp;<​tt>​current_user</​tt>​ +
- +
-|- +
-| style="​background-color:#​ffffff;​border-top:​none;​border-bottom:​0.0361in double #​808080;​border-left:​0.0361in double #​808080;​border-right:​none;​padding:​0.0194in;"​| <tt>version()</tt> +
-| style="​background-color:#​ffffff;​border-top:​none;​border-bottom:​0.0361in double #​808080;​border-left:​0.0361in double #​808080;​border-right:​none;​padding:​0.0194in;"​| <tt>text</tt> +
-| style="​background-color:#​ffffff;​border-top:​none;​border-bottom:​0.0361in double #​808080;​border-left:​0.0361in double #​808080;​border-right:​0.0361in double #​808080;​padding:​0.0194in;"​| PostgreSQL&​nbsp;​version ​information +
- +
-|} +
- +
  
resources.txt · Last modified: 2020/08/10 02:35 (external edit)