2. DBMS이야기/01. PostgreSQL

[PostgreSQL] PostgreSQL 기본 정보 확인

OSSW(Open Source System SoftWare 2014. 8. 11. 16:02

 

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_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_conf_load_time() timestamp with time zone configuration load time
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_my_temp_schema() oid OID of session's temporary schema, or 0 if none
pg_postmaster_start_time() timestamp with time zone server start time
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
version() text PostgreSQL version information

 

 ㅇ 현재 PostgreSQL 사용 Port

postgres=# SELECT inet_server_port();

 

ㅇ 현재 Database

postgres=# SELECT current_database();

 

ㅇ 현재 접속 User

postgres=# SELECT current_user;

 

ㅇ 현재 Server IP

postgres=# SELECT inet_server_addr();

 

ㅇ 현재 PostgreSQL Version

postgres=# SELECT version();

 

ㅇ 현재 PostgreSQL 시간

postgres=# SELECT current_time;

 

ㅇ 현재 PostgreSQL의 시작 시간

postgres=# SELECT pg_postmaster_start_time();

 

ㅇ 현재 PostgreSQL 에 존재하는 Database

postgres=# SELECT datname from pg_database;

 

 

출처 :  http://dbrang.tistory.com/750

 

by.백준