Re: [PATCH] Proposed: Have SPI_connect fail if there is no current snapshot - Mailing list pgsql-patches

From Tom Lane
Subject Re: [PATCH] Proposed: Have SPI_connect fail if there is no current snapshot
Date
Msg-id 26239.1123971726@sss.pgh.pa.us
Whole thread Raw
In response to [PATCH] Proposed: Have SPI_connect fail if there is no current snapshot  (Martijn van Oosterhout <kleptog@svana.org>)
Responses Re: [PATCH] Proposed: Have SPI_connect fail if there is no current snapshot
List pgsql-patches
Martijn van Oosterhout <kleptog@svana.org> writes:
> As per discussion on -hackers, type input functions can be called prior
> to there being a current snapshot, causing any queries you execute to
> fail with the "no snapshot has been set" error. So I propose to simply
> have SPI_connect fail right off the bat and document that to avoid
> future surprises.

This strikes me as a pretty unreasonable restriction.  It would be OK
if there were no valid uses of SPI that didn't require a snapshot, but
that's not so.  As an example, consider trying to issue a LOCK TABLE
command via SPI (okay, there are other ways to do that, but it's still
a valid example).

            regards, tom lane

pgsql-patches by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: [PATCH] Proposed: Have SPI_connect fail if there is no current snapshot
Next
From: Tom Lane
Date:
Subject: Re: [PATCH] Clarify issues with SPI and C language function limitations