I'm using SELECT current_query FROM pg_stat_activity;
to see the currently executing queries, but I noticed that the query is truncated. Is there any workaround or any other way to see the currently executing queries?
pg_stat_activity is a system view that allows you to identify active SQL queries in AnalyticDB for PostgreSQL instances. The pg_stat_activity view shows a server process and its related session and query in each row.
backend_xid means Top-level transaction identifier of this backend, if any. backend_xmin means The current backend's xmin horizon.
The pg_stat_statements module provides a means for tracking planning and execution statistics of all SQL statements executed by a server. The module must be loaded by adding pg_stat_statements to shared_preload_libraries in postgresql. conf , because it requires additional shared memory.
Go to Dashboard in your pgAdmin. At the bottom, in the Server Activity section, under the Sessions Tab, you can see all the Active queries. Now, notice the cross button and the Stop button to the left of each query.
ALTER SYSTEM SET track_activity_query_size = 16384;
You will still need to restart the service for that to take effect
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With