From: | Merlin Moncure <mmoncure(at)gmail(dot)com> |
---|---|
To: | Bernice Southey <bernice(dot)southey(at)gmail(dot)com> |
Cc: | pgsql-general(at)lists(dot)postgresql(dot)org |
Subject: | Re: Are SQL-language function lock ordering deadlocks solved in PostgreSQL 18? |
Date: | 2025-10-07 20:51:12 |
Message-ID: | CAHyXU0wGxp0oLKU+65Su5-Q04Sz3=H2DZYK843XhguwEHvEkQA@mail.gmail.com |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Mon, Oct 6, 2025 at 10:54 AM Bernice Southey <bernice(dot)southey(at)gmail(dot)com>
wrote:
> Hi pgsql-general community,
>
> I tried the simple test from the original mail [1] and indeed got
> deadlocks in version 17, but not 18. Yet absence of evidence is not
> proof of no race conditions.
>
> This might be my favourite change in 18 [2], if I'm understanding it
> right. I much prefer the install-time checking of SQL-language
> functions, and the elegance of pure SQL. But I've been convinced the
> performance benefit of plan caching gave PL/pgSQL the edge. Now I'm
> not so sure.
>
It sure seems like the intent of the change was to modify exactly that
behavior.
If you look at the major built-in sql-esque languages, sql(old), sql(new),
PSM (new standard syntax) and pl/pgsql, I guess psm style and pure SQL
might be overlapped with PSM style functions, especially if PSM functions
can be inlined (I haven't looked yet)-- inlining of functions such as
'SELECT $1 + $2' being the only reason I write sql functions these days.
I have always found the strict compile time checking to be highly
obnoxious except in the immutable/inlinable cases that come up now and
then.
Plan caching is not so important IMO, since execution time tends to greatly
exceed plan time in my experience and the real performance bugaboo is bad,
not uncached plans. FIxing bad plans typically involves dipping into the
pl/pgsql toolbox, using variable temp tables, planner directives, and other
forbidden tools in PSM. In simple terms, I also used to restrict server
side coding views and pure sql functions for abstraction, but have long
since given up, and mainly write procedures :-).
I really wish PSM functions could do what pl/pgsql functions do, since I
like the creation syntax vs the 'string is body of code',but, alas.
merlin
From | Date | Subject | |
---|---|---|---|
Next Message | Krrish Malhotra | 2025-10-08 09:11:33 | JSONB subscripting initializes numeric keys as arrays instead of objects |
Previous Message | shammat | 2025-10-06 14:59:39 | Re: Does Java 8 support drivers 42.2.19 and 42.7.6? |