{
  "slug": "postgres-find-long-running-queries",
  "title": "Find Long-Running PostgreSQL Queries",
  "fixture": "containers/db-first-response-lab",
  "command_count": 3,
  "container_tool": "docker",
  "image": "localhost/linuxoneliners-lab:latest",
  "exit_code": 0,
  "elapsed_ms": 199,
  "stdout": "::fixture-ready::\n$ psql -X -c \"select now();\"\n              now\n-------------------------------\n 2026-06-25 13:00:00+00\n(1 row)\n::exit-code::0\n$ psql -X -c \"select pid, now() - query_start as age, state, left(query, 80) as query from pg_stat_activity where query_start is not null order by age desc limit 10;\"\n pid |   age    | state  |              query\n-----+----------+--------+----------------------------------\n 511 | 00:12:44 | active | update invoices set status\n 518 | 00:08:02 | active | alter table orders add column\n(2 rows)\n::exit-code::0\n$ psql -X -c \"select state, count(*) from pg_stat_activity group by state;\"\n state  | count\n--------+-------\n active |     2\n idle   |     2\n(2 rows)\n::exit-code::0\n",
  "stderr": "",
  "ok": true,
  "security": {
    "network": "none",
    "capabilities": "dropped",
    "no_new_privileges": true,
    "memory": "256m",
    "cpus": "1",
    "pids_limit": 128,
    "tmpfs": [
      "/tmp",
      "/var"
    ]
  }
}