PostgreSQL blocked locks query

From: Manoj Kumar <manojkumar(at)temenos(dot)com>
To: "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: PostgreSQL blocked locks query
Date: 2021-05-13 13:54:32
Message-ID: SJ0PR04MB7662ACFCDECF38E62B08A38AD9519@SJ0PR04MB7662.namprd04.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Hi Team,

I have query in terms of lock monitoring in PostgreSQL where I am not able to find a way to figure out what value has been passed in SQL statement (from JDBC driver as prepared statement).

I am using PostgreSQL 13 version.

The following is the SQL statement I am running in PGAdmin

SELECT
activity.pid as BlockedPid,
activity.usename,
activity.query,
blocking.pid AS Blocking_Pid,
to_char(now() - activity.query_start, 'HH24:MI:SS') as elapsed
FROM pg_stat_activity AS activity
JOIN pg_stat_activity AS blocking ON blocking.pid = ANY(pg_blocking_pids(activity.pid));

The output I am getting is below, where in the SQL query is with $1.

[cid:image001(dot)png(at)01D74810(dot)4207C100]

Is there a way to compute what is being passed as value for the above SQL statement ?

Thanks

The information in this e-mail and any attachments is confidential and may be legally privileged. It is intended solely for the addressee or addressees. Any use or disclosure of the contents of this e-mail/attachments by a not intended recipient is unauthorized and may be unlawful. If you have received this e-mail in error please notify the sender. Please note that any views or opinions presented in this e-mail are solely those of the author and do not necessarily represent those of TEMENOS. We recommend that you check this e-mail and any attachments against viruses. TEMENOS accepts no liability for any damage caused by any malicious code or virus transmitted by this e-mail.

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Justin Pryzby 2021-05-13 20:09:25 Re: PostgreSQL blocked locks query
Previous Message Eugen Konkov 2021-05-13 13:35:13 Re: BUG #16968: Planner does not recognize optimization