Hi,
> The patch changes the order to:
>
> StartTransactionCommand();
> PushActiveSnapshot(...);
> SPI_connect();
>
> ...
>
> SPI_finish();
> PopActiveSnapshot();
> CommitTransactionCommand();
>
> ... and also clarifies that the order of PushActiveSnapshot(...) and
> SPI_connect() is not important.
Additionally I noticed that the check:
```
if (!process_shared_preload_libraries_in_progress)
return;
```
... was misplaced in _PG_init(). Here is the patch v2 which fixes this too.
--
Best regards,
Aleksander Alekseev