RE: Commit with wait event on advisory lock! - Mailing list pgsql-admin

From
Subject RE: Commit with wait event on advisory lock!
Date
Msg-id 00e801db6c63$acd0f8a0$0672e9e0$@msym.fr
Whole thread Raw
In response to Re: Commit with wait event on advisory lock!  (Rajesh Kumar <rajeshkumar.dba09@gmail.com>)
Responses Re: Commit with wait event on advisory lock!
List pgsql-admin

Hi

 

I know very well advisory locks. The question is:

 

How a COMMIT statement could be blocked by a lock whatever the kind of the lock could be. COMMIT releases locks. How could it be blocked by a lock?!

 

Regards

 

Michel SALAIS

 

De : Rajesh Kumar <rajeshkumar.dba09@gmail.com>
Envoyé : mardi 21 janvier 2025 15:57
À : msalais@msym.fr
Cc : pgsql-admin@lists.postgresql.org
Objet : Re: Commit with wait event on advisory lock!

 

Advisory locks are used by developers

 

On Tue, 21 Jan 2025, 20:18 , <msalais@msym.fr> wrote:

Hi all,

 

I have long commits on a production database. To know why this happens I organized a snapshot system on table pg_stat_activity.

When I check the result I have this row in it:

 

postgres=# select * from public.fdj_ms_slow_stmts where pid = 2285947 \gx

-[ RECORD 1 ]----+-----------------------------------------------------------------------------------------------------------------------

datname          | some_db

pid              | 2285947

leader_pid       |

usename          | some_user

application_name | PostgreSQL JDBC Driver

backend_start    | 2025-01-21 04:25:17.254477+01

xact_start       | 2025-01-21 05:55:19.426945+01

query_start      | 2025-01-21 05:55:19.428651+01

stmt_duration    | 00:00:02.140691

tx_idle_duration | 00:00:00

ts_now           | 2025-01-21 05:55:21.569342+01

state            | active

wait_event_type  | Lock

wait_event       | advisory

query_id         |

query            | COMMIT

 

Is this possible ?

I am really surprised !

 

Michel SALAIS

pgsql-admin by date:

Previous
From: Edwin UY
Date:
Subject: Is there a way to check if objects are created with quotes or not?
Next
From: Tom Lane
Date:
Subject: Re: Commit with wait event on advisory lock!