Re: abort-time portal cleanup

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Dilip Kumar <dilipbalaut(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: abort-time portal cleanup
Date: 2019-10-07 16:27:55
Message-ID: CA+TgmoZOWt2t5+WV-0ggCc+oisqXy49+MVAYv8WHJZtbpcp=Jg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Sep 24, 2019 at 6:34 AM Dilip Kumar <dilipbalaut(at)gmail(dot)com> wrote:
> On Fri, Sep 13, 2019 at 2:13 AM Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> >
> /*
> * Otherwise, do nothing to cursors held over from a previous
> * transaction.
> */
> if (portal->createSubid == InvalidSubTransactionId)
> continue;
>
> /*
> * Do nothing to auto-held cursors. This is similar to the case of a
> * cursor from a previous transaction, but it could also be that the
> * cursor was auto-held in this transaction, so it wants to live on.
> */
> if (portal->autoHeld)
> continue;
>
> I have one doubt that why do we need the second check. Because before
> setting portal->autoHeld to true we always call HoldPortal therein we
> set portal->createSubid to InvalidSubTransactionId. So it seems to me
> that the second condition will never reach. Am I missing something?

Not that I can see, but I don't necessarily think this patch needs to
change it, either.

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2019-10-07 16:30:37 Re: Transparent Data Encryption (TDE) and encrypted files
Previous Message Robert Haas 2019-10-07 16:14:52 Re: abort-time portal cleanup