BUG #17140: pg_try_advisory_xact_lock produces a WARNINIG on unsuccessful lock - Mailing list pgsql-bugs

From PG Bug reporting form
Subject BUG #17140: pg_try_advisory_xact_lock produces a WARNINIG on unsuccessful lock
Date
Msg-id 17140-38f50de605441268@postgresql.org
Whole thread Raw
Responses Re: BUG #17140: pg_try_advisory_xact_lock produces a WARNINIG on unsuccessful lock  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      17140
Logged by:          Yuri Cherio
Email address:      cherio@gmail.com
PostgreSQL version: 13.3
Operating system:   Ubuntu Linux 20.04
Description:

Function "pg_try_advisory_xact_lock" triggers a WARNING message when the
lock is already owned by someone else. The documentation explicitly mentions
warnings on advisory unlock functions and those are understandable - the
developer should not try to unlock what's not owned.

However the advisory lock functions are there for this specific reason -
test whether a resource is locked or not. A negative test should not produce
a WARNING.


pgsql-bugs by date:

Previous
From: Kacey Holston
Date:
Subject: Re: Issue with logical replication
Next
From: Rainer Tammer
Date:
Subject: Re: Postgres 9.2.13 on AIX 7.1