Pg_backend_pid
Cancel vs Terminate PostgreSQL Backends Explained
Apr 14, 2026 / · 4 min read · postgresql administration database performance pg_stat_activity pg_backend_pid pg_cancel_backend pg_terminate_backend ·Cancel vs Terminate PostgreSQL Backends: What Every DBA Should Know PostgreSQL gives you two tools for dealing with problem backends: pg_cancel_backend() and pg_terminate_backend(). They sound similar but behave very differently. Using the wrong one can disrupt users unnecessarily, or leave a problematic connection in …
Read MoreKill Idle PostgreSQL Sessions with SQL
Mar 24, 2026 / · 9 min read · postgresql database administration sql queries connection management performance tuning pg_stat_activity postgres dba pg_backend_pid pg_cancel_backend pg_terminate_backend ·Kill Idle PostgreSQL Sessions with SQL The connection count sits at max_connections, new clients are being refused, and pg_stat_activity is full of sessions that have run nothing for hours. Freeing the slots takes one statement, pg_terminate_backend(), but the choices around it decide whether the cleanup is safe: which …
Read MorePostgreSQL SSL Settings Query Guide
Mar 17, 2026 / · 5 min read · postgresql database administration sql queries security ssl configuration pg_settings postgres dba pg_stat_ssl pg_backend_pid ·PostgreSQL SSL Settings Query Guide This PostgreSQL query retrieves all SSL and TLS configuration settings from the pg_settings system view. It surfaces whether SSL is enabled, which certificates and keys are in use, what cipher suites are allowed, and all other SSL-related parameters. Purpose and Overview Encrypting …
Read MoreMonitor Running Queries in PostgreSQL using pg_stat_activity
Aug 18, 2025 / · 9 min read · postgresql database sql performance monitoring pg_stat_activity pg_locks pg_backend_pid pg_blocking_pids ·Monitor Running Queries in PostgreSQL with pg_stat_activity Where pg_stat_statements aggregates queries that already finished and pgBadger reads logs after the fact, pg_stat_activity is the real-time snapshot: one row per server process, showing what each one is doing at the moment the query runs. It is the right …
Read MoreHow to Monitor Slow Running Queries in PostgreSQL
May 19, 2025 / · 8 min read · postgresql performance monitoring troubleshooting pg_stat_activity pg_backend_pid ·Monitor Slow Running Queries in PostgreSQL with pg_stat_activity An application hangs, the connection pool fills up, and somewhere a statement has been running for minutes. pg_stat_activity shows it for every backend on the server: how long the current query has been going, which role and database it belongs to, and …
Read MoreKeep Your PostgreSQL Database Clean, Identify Idle Connections
Identify Idle PostgreSQL Connections: Keep Your Database Clean A session in state idle since 09:14 is a client that connected, finished its work and never hung up. pg_stat_activity has one row per server process, and its state and state_change columns list every session like it. A short query against that view lists …
Read MoreUnveiling Your PostgreSQL Server - A Diagnostic Powerhouse
Apr 4, 2024 / · 6 min read · postgresql database server administration monitoring pg_settings pg_backend_pid pg_backup_start_time pg_conf_load_time pg_current_logfile pg_is_in_backup pg_is_in_recovery pg_is_wal_replay_paused pg_jit_available pg_last_wal_receive_lsn pg_last_wal_replay_lsn pg_last_xact_replay_timestamp pg_listening_channels pg_ls_archive_statusdir pg_ls_logdir pg_ls_tmpdir pg_ls_waldir pg_postmaster_start_time pg_reload_conf pg_rotate_logfile pg_sleep pg_sleep_for pg_sleep_until ·Unveiling Your PostgreSQL Server: A Treasure Trove of Information This comprehensive PostgreSQL script delves into the inner workings of your database server, revealing valuable details about its version, configuration, connections, users, and more. It empowers database administrators and developers with insights to …
Read More