Re: Exposing the lock manager's WaitForLockers() to SQL

From: Will Mortensen <will(at)extrahop(dot)com>
To: vignesh C <vignesh21(at)gmail(dot)com>
Cc: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, Andres Freund <andres(at)anarazel(dot)de>, Marco Slot <marco(dot)slot(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org, marco(at)citusdata(dot)com, Yvonne Chen <yvonne(at)extrahop(dot)com>, Jacob Speidel <jacob(at)extrahop(dot)com>
Subject: Re: Exposing the lock manager's WaitForLockers() to SQL
Date: 2024-01-29 03:28:05
Message-ID: CAMpnoC4=pAYk_eNsLExY_tmaRJbpqymB2xPupAwdzjofb=_LMw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jan 26, 2024 at 4:54 AM vignesh C <vignesh21(at)gmail(dot)com> wrote:
>
> CFBot shows that there is one warning as in [1]:
> patching file doc/src/sgml/libpq.sgml
> ...
> [09:30:40.000] [943/2212] Compiling C object
> src/backend/postgres_lib.a.p/storage_lmgr_lock.c.obj
> [09:30:40.000] c:\cirrus\src\backend\storage\lmgr\lock.c(4084) :
> warning C4715: 'ParseLockmodeName': not all control paths return a
> value

Thanks Vignesh, I guess the MS compiler doesn't have
__builtin_constant_p()? So I added an unreachable return, and a
regression test that exercises this error path.

I also made various other simplifications and minor fixes to the code,
docs, and tests.

Back in v5 (with a new SQL command) I had a detailed example in the
docs, which I removed when changing to a function, and I'm not sure if
I should try to add it back now...I could shrink it but it might still
be too long for this part of the docs?

Anyway, please see attached.

Attachment Content-Type Size
v7-0001-Refactor-GetLockConflicts-into-more-general-GetLo.patch application/octet-stream 10.6 KB
v7-0002-Allow-specifying-single-lockmode-in-WaitForLocker.patch application/octet-stream 8.2 KB
v7-0003-Add-pg_wait_for_lockers-function.patch application/octet-stream 31.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Junwang Zhao 2024-01-29 03:37:07 Re: Make COPY format extendable: Extract COPY TO format implementations
Previous Message Masahiko Sawada 2024-01-29 03:21:48 Re: Make COPY format extendable: Extract COPY TO format implementations