Re: Re: [COMMITTERS] pgsql: Prevent "snapshot too old" from trying to return pruned TOAST tu

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: [COMMITTERS] pgsql: Prevent "snapshot too old" from trying to return pruned TOAST tu
Date: 2016-08-05 16:04:15
Message-ID: CA+TgmoZzBJ0GHBsgkXMQwdonUF6uSLY+z6w-1B0bzNi+TKpA_g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On Fri, Aug 5, 2016 at 11:05 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
>> On Thu, Aug 4, 2016 at 10:58 PM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>>> 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.
>
> Well, the alternative would be to put "#ifndef FRONTEND" around the
> static-inline function. That's not very pretty either, and it's
> inconsistent with the existing precedent (ie, InitDirtySnapshot).
> Also, it presumes that a non-backend includer actually has defined
> FRONTEND; that seems to be the case for pg_xlogdump but I do not
> think we do that everywhere.

That may not be pretty, but it'd be a lot more transparent. If I see
#ifndef FRONTEND, I think, oh, that's protecting some stuff that
shouldn't be included in front-end compiles. If I see a macro, I not
necessarily think of the fact that this may be a way of preventing
that code from being compiled in front-end compiles.

>> Here's a patch. Is this what you want?
>
> OK by me.

OK, committed.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2016-08-05 16:59:44 pgsql: Update time zone data files to tzdata release 2016f.
Previous Message Robert Haas 2016-08-05 16:04:12 pgsql: Change InitToastSnapshot to a macro.

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2016-08-05 16:04:19 money type overflow checks
Previous Message David Fetter 2016-08-05 15:58:07 Re: Column COMMENTs in CREATE TABLE?