On Thu, Aug 4, 2016 at 10:58 PM, Robert Haas <robertmhaas@gmail.com> wrote:
> On Thu, Aug 4, 2016 at 7:23 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Robert Haas <rhaas@postgresql.org> writes:
>>> Prevent "snapshot too old" from trying to return pruned TOAST tuples.
>>
>> Looks like this patch broke the build on castoroides. Recommend
>> changing InitToastSnapshot into a macro. (There's a reason why
>> InitDirtySnapshot is a macro.)
>
> What is the reason? We refuse to separate frontend and backend
> headers in any sort of principled way?
That was poorly phrased. I'll try again: I can't see any reason for
using a macro here except that it allows frontend code to compile this
without breaking. But that doesn't seem like a very good way of
solving that problem. There's surely no way for a casual reader of
the code to realize that macros can be used here and inline functions
cannot, especially because this works apparently works fine on most
machines, including mine.
Here's a patch. Is this what you want?
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company