Re: [PATCH] Slight improvement of worker_spi.c example - Mailing list pgsql-hackers

From Aleksander Alekseev
Subject Re: [PATCH] Slight improvement of worker_spi.c example
Date
Msg-id CAJ7c6TOaX8wf60DVozm=cLLLFoLX1O7rM8fiHdURq1+FV1NDWw@mail.gmail.com
Whole thread Raw
In response to [PATCH] Slight improvement of worker_spi.c example  (Aleksander Alekseev <aleksander@timescale.com>)
Responses Re: [PATCH] Slight improvement of worker_spi.c example
List pgsql-hackers
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

Attachment

pgsql-hackers by date:

Previous
From: Ranier Vilela
Date:
Subject: Avoid unused value (src/fe_utils/print.c)
Next
From: Julien Rouhaud
Date:
Subject: Re: [PATCH] Slight improvement of worker_spi.c example