Re: Assertion failure in HEAD and 13 after calling COMMIT in a stored proc

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Greg Nancarrow <gregn4422(at)gmail(dot)com>
Cc: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>, nasbyj(at)amazon(dot)com, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Assertion failure in HEAD and 13 after calling COMMIT in a stored proc
Date: 2021-06-24 00:51:05
Message-ID: 2559111.1624495865@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Greg Nancarrow <gregn4422(at)gmail(dot)com> writes:
> On Wed, Jun 23, 2021 at 11:01 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> The comment is written in terms of "when can we
>> skip taking a snapshot", while the test in the code is written for
>> the inverse condition "when do we need a snapshot".

> Perhaps that code could have been written as the following, to better
> align with the comments:
> [ invert the variable's meaning ]

Yeah, perhaps. I remember feeling that the code was clearer this
way (because "if (!skip_snapshot)" seems a little backwards).
But it might be better to make the code fit the comment than to
try to invert the description in the comment.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2021-06-24 01:13:55 Re: Deadlock risk while inserting directly into partition?
Previous Message Tom Lane 2021-06-24 00:45:40 Re: Deadlock risk while inserting directly into partition?