Re: *_to_xml() should copy SPI_processed/SPI_tuptable - Mailing list pgsql-hackers

From Chapman Flack
Subject Re: *_to_xml() should copy SPI_processed/SPI_tuptable
Date
Msg-id 5B905AC9.1040403@anastigmatix.net
Whole thread Raw
In response to Re: *_to_xml() should copy SPI_processed/SPI_tuptable  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: *_to_xml() should copy SPI_processed/SPI_tuptable  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 09/05/18 18:07, Tom Lane wrote:

> * Replace SPI_tuptable et al with macros that access fields in the
> current SPI stack level (similar to the way that, eg, errno works
> on most modern platforms).  This seems do-able, if a bit grotty.

It would mean they'd have to *be* in the stack frame, where they
currently aren't; they're ignored by SPI_connect and just zeroed
by SPI_finish, on the grounds that they're transient and you've
copied them if you care.

Another alternative might be to have SPI_connect save them and
SPI_finish put them back, which leaves you just responsible for
reasoning about your own code. You'd still be expected to save them
across your own uses of other SPI calls, but no longer exposed to
spooky action at a distance from nested uses of SPI in stuff you call.

-Chap


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: unaccent(text) fails depending on search_path (WAS: pg_upgrade fails saying function unaccent(text) doesn't exist)
Next
From: Tom Lane
Date:
Subject: Re: On the need for a snapshot in exec_bind_message()