Session Information Functions
pg_backend_pid()
Description: Process ID of the service process connected to the current session.
Return type: integer.
Example:
1 2 3 4 5 |
SELECT pg_backend_pid(); pg_backend_pid ----------------- 140229352617744 (1 row) |
pg_postmaster_start_time()
Description: Server start time. pg_postmaster_start_time returns the timestamp with time zone when the server started.
Return type: timestamp with time zone.
Example:
1 2 3 4 5 |
SELECT pg_postmaster_start_time(); pg_postmaster_start_time ------------------------------ 2017-08-30 16:02:54.99854+08 (1 row) |
session_user
Description: Session username. session_user is typically the initial user who connects to the current database.
Return type: name.
Example:
1 2 3 4 5 |
SELECT session_user; session_user -------------- dbadmin (1 row) |
user
Description: Equivalent to current_user.
Return type: name.
Example:
1 2 3 4 5 |
SELECT user; current_user -------------- dbadmin (1 row) |
version()
Description: Version information. version returns a string describing the server's version information.
Return type: text.
Example:
1 2 3 4 5 |
SELECT version(); version --------------------------------------------------------------------------------------------------------------------------------------- PostgreSQL 9.2.4 gsql ((GaussDB 8.2.1 build 39137c2d) compiled at 2022-09-23 15:43:11 commit 3629 last mr 5138 release) on x86_64-unknown-linux-gnu, compiled by g++ (GCC) 5.4.0, 64-bit (1 row) |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot