Current PID in Postgres June 9, 2021 This returns the PID of the current psql session: select pg_backend_pid()