pgrx icon indicating copy to clipboard operation
pgrx copied to clipboard

Added non-atomic SPI connection

Open YohDeadfall opened this issue 1 year ago • 4 comments

Here's my take on making non-atomic SPI connections, but it lacks tests as I don't understand how to properly make them without dealing with portals directly. If I'm not wrong there were tests using a client to issue requests to the server with the required extensions, so it should be like that then.

YohDeadfall avatar Sep 24 '24 15:09 YohDeadfall

What's the use case for non-atomic SPI?

eeeebbbbrrrr avatar Sep 24 '24 15:09 eeeebbbbrrrr

It's used primarily if not only by language handlers which take that information from the current call. The problem I see is that the native API allows opting-in into non-atomic connections using SPI_connect_ext, but the provided implementation is less flexible, but more sound because with atomic connections no transaction control functions are allowed.

YohDeadfall avatar Sep 24 '24 15:09 YohDeadfall

What's the use case for non-atomic SPI?

Non-atomic SPI can be quite useful for stored procedures and background workers

By the way, I'm curious why pgrx doesn't offer more native support for stored procedures

dpxcc avatar Apr 22 '25 03:04 dpxcc

By the way, I'm curious why pgrx doesn't offer more native support for stored procedures

It's purely contributor based now, no company owns it or sponsors it.

YohDeadfall avatar Apr 22 '25 06:04 YohDeadfall