Postgres 9.6.1
I have an insert query that appears to be ending up in a deadlock.
select pid, usename,
pg_blocking_pids(pid) as blocked_by,
query as blocked_query
from pg_stat_activity where cardinality(pg_blocking_pids(pid)) > 0;
-[ RECORD 1 ]-+-----------------------------------------------------
pid | 14282 usename | ap10310 blocked_by | {12614} blocked_query | insert into sctdps_rec values ($1,$2,$3,$4,$5,$6,$7)
select pid, wait_event_type, wait_event, state, query from
pg_stat_activity where pid=12614;
-[ RECORD 1 ]---+----------------------------------------------------
pid | 12614 wait_event_type |
wait_event |
state | idle in transaction query | select * from rprrcs_rec where rcs_rc_id = $1
and rcs_lng = $2 and rcs_apln_pfx = $3 and
rcs_apln_no = $4 and rcs_apln_no_sub = $5
While this is is great and I should be able to track down where and why
these two became conflicted, I was just wondering if there is any place
such as pg_stat_activity that might tell me what the values were that
were set for the $1 through $7 when the query was formed. Is this a case where the explain would need to be used to see that?
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 296 |
Nodes: | 16 (2 / 14) |
Uptime: | 50:41:04 |
Calls: | 6,649 |
Calls today: | 1 |
Files: | 12,200 |
Messages: | 5,330,212 |