PG_STAT_ACTIVITY_NG
PG_STAT_ACTIVITY_NG displays information about all queries in the logical cluster (The current feature is a lab feature. Contact Huawei technical support before using it.) of the current user.
Name |
Type |
Description |
---|---|---|
datid |
oid |
OID of the database that the user session connects to in the backend |
datname |
name |
Name of the database that the user session connects to in the backend |
pid |
bigint |
Process ID of the backend |
sessionid |
bigint |
Session ID |
global_sessionid |
text |
Global session ID |
usesysid |
oid |
OID of the user logged in to the backend |
usename |
name |
OID of the user logged in to the backend |
application_name |
text |
Name of the application connected to the backend |
client_addr |
inet |
IP address of the client connected to the backend. If this column is null, either the client is connected via a Unix socket on the server machine or this is an internal process such as autovacuum. |
client_hostname |
text |
Host name of the connected client, as reported by a reverse DNS lookup of client_addr. This column will only be non-null for IP connections, and only when log_hostname is enabled. |
client_port |
integer |
TCP port number that the client uses for communication with this backend (-1 if a Unix socket is used) |
backend_start |
timestamp with time zone |
Time when this process was started, that is, when the client connected to the server |
xact_start |
timestamp with time zone |
Time when current transaction was started (null if no transaction is active) If the current query is the first of its transaction, this column is equal to the query_start column. |
query_start |
timestamp with time zone |
Time when the currently active query was started, or if state is not active, when the last query was started |
state_change |
timestamp with time zone |
Time when the status was changed in the previous time |
waiting |
boolean |
Whether the backend is currently waiting on a lock. If it is, its value is true. Otherwise, the value is false. |
enqueue |
text |
Queuing status of a statement. The value must be one of the following:
|
state |
text |
Backend status. The value must be one of the following:
NOTE:
Common users can view only their own session status. The state information of other accounts is empty. For example, after user judy is connected to the database, the state information of user joe and the initial user omm in pg_stat_activity is empty. SELECT datname, usename, usesysid, state,pid FROM pg_stat_activity_ng; datname | usename | usesysid | state | pid ----------+---------+----------+--------+----------------- postgres | omm | 10 | | 139968752121616 postgres | omm | 10 | | 139968903116560 db_tpcds | judy | 16398 | active | 139968391403280 postgres | omm | 10 | | 139968643069712 postgres | omm | 10 | | 139968680818448 postgres | joe | 16390 | | 139968563377936 (6 rows) |
resource_pool |
name |
Resource pool used by the user |
query_id |
bigint |
ID of a query |
query |
text |
Latest query at the backend. If state is active, this column shows the executing query. In all other states, it shows the last query that was executed. |
node_group |
text |
Logical cluster (The current feature is a lab feature. Contact Huawei technical support before using it.) of the user running the statement |
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