Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Later
    • 3.0.0
    • None
    • SQL
    • None

    Description

      Name Return Type Description
      current_catalog name name of current database (called “catalog” in the SQL standard)
      current_database() name name of current database
      current_query() text text of the currently executing query, as submitted by the client (might contain more than one statement)
      current_role name equivalent to current_user
      current_schema[()] name name of current schema
      current_schemas(boolean) name[] names of schemas in search path, optionally including implicit schemas
      current_user name user name of current execution context
      inet_client_addr() inet address of the remote connection
      inet_client_port() int port of the remote connection
      inet_server_addr() inet address of the local connection
      inet_server_port() int port of the local connection
      pg_backend_pid() int Process ID of the server process attached to the current session
      pg_blocking_pids(int) int[] Process ID(s) that are blocking specified server process ID from acquiring a lock
      pg_conf_load_time() timestamp with time zone configuration load time
      pg_current_logfile([{{text}}]) text Primary log file name, or log in the requested format, currently in use by the logging collector
      pg_my_temp_schema() oid OID of session's temporary schema, or 0 if none
      pg_is_other_temp_schema(oid) boolean is schema another session's temporary schema?
      pg_listening_channels() setof text channel names that the session is currently listening on
      pg_notification_queue_usage() double fraction of the asynchronous notification queue currently occupied (0-1)
      pg_postmaster_start_time() timestamp with time zone server start time
      pg_safe_snapshot_blocking_pids(int) int[] Process ID(s) that are blocking specified server process ID from acquiring a safe snapshot
      pg_trigger_depth() int current nesting level of PostgreSQL triggers (0 if not called, directly or indirectly, from inside a trigger)
      session_user name session user name
      user name equivalent to current_user

      Example:

      postgres=# SELECT pg_collation_for(description) FROM pg_description LIMIT 1;
       pg_collation_for
      ------------------
       "default"
      (1 row)
      

      https://www.postgresql.org/docs/10/functions-info.html

      Attachments

        Activity

          People

            Unassigned Unassigned
            yumwang Yuming Wang
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: