pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Minor code review for tuple slot rewrite.
Date: Wed, 06 Nov 2019 17:00:25 +0000
Message-ID: <E1iSOfR-0007TI-Le@gemulon.postgresql.org> (raw)

Minor code review for tuple slot rewrite.

Avoid creating transiently-inconsistent slot states where possible,
by not setting TTS_FLAG_SHOULDFREE until after the slot actually has
a free'able tuple pointer, and by making sure that we reset tts_nvalid
and related derived state before we replace the tuple contents.  This
would only matter if something were to examine the slot after we'd
suffered some kind of error (e.g. out of memory) while manipulating
the slot.  We typically don't do that, so these changes might just be
cosmetic --- but even if so, it seems like good future-proofing.

Also remove some redundant Asserts, and add a couple for consistency.

Back-patch to v12 where all this code was rewritten.

Discussion: https://postgr.es/m/16095-c3ff2e5283b8dba5@postgresql.org

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/9dbc6d25a97d11475fde36c4f71359371bbe240b

Modified Files
--------------
src/backend/executor/execTuples.c | 81 +++++++++++++++++++++------------------
src/include/executor/tuptable.h   |  5 +--
2 files changed, 45 insertions(+), 41 deletions(-)



view thread (2+ messages)

Message-ID: <E1iSOfR-0007TI-Le@gemulon.postgresql.org>
Permalink:  ../E1iSOfR-0007TI-Le@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1iSOfR-0007TI-Le@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Minor code review for tuple slot rewrite.
  In-Reply-To: <E1iSOfR-0007TI-Le@gemulon.postgresql.org>
  References: <E1iSOfR-0007TI-Le@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox