magnobiet
5/20/2016 - 2:40 PM

Database

Database

-- PostgreSQL and MySQL
SELECT version();
-- PostgreSQL
SELECT
  datname,
  usename,
  query,
  waiting,
  state,
  backend_start,
  xact_start,
  query_start,
  state_Change,
  client_addr || ':' || client_port AS client
FROM pg_stat_activity;

-- MySQL
SHOW PROCESSLIST;