On Sat, 2024-01-06 at 02:57 -0800, Will Mortensen wrote: > Simplified the code and docs, and rewrote the example with more prose > instead of PL/pgSQL, which unfortunately made it longer, although it > could be truncated. Not really sure what's best...
I thought about this idea, and I have some doubts. WAIT FOR LOCKERS only waits for transactions that were holding locks when the statement started. Transactions that obtailed locks later on are ignored. While your original use case is valid, I cannot think of any other use case. So it is a special-purpose statement that is only useful for certain processing of append-only tables. Is it worth creating a new SQL statement for that, which could lead to a conflict with future editions of the SQL standard? Couldn't we follow the PostgreSQL idiosyncrasy of providing a function with side effects instead? Yours, Laurenz Albe