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: Assert that we don't insert nulls into attnotnull catalog column
Date: Tue, 21 Jul 2020 16:38:34 +0000
Message-ID: <E1jxvHm-0002KM-Do@gemulon.postgresql.org> (raw)

Assert that we don't insert nulls into attnotnull catalog columns.

The executor checks for this error, and so does the bootstrap catalog
loader, but we never checked for it in retail catalog manipulations.
The folly of that has now been exposed, so let's add assertions
checking it.  Checking in CatalogTupleInsert[WithInfo] and
CatalogTupleUpdate[WithInfo] should be enough to cover this.

Back-patch to v10; the aforesaid functions didn't exist before that,
and it didn't seem worth adapting the patch to the oldest branches.
But given the risk of JIT crashes, I think we certainly need this
as far back as v11.

Pre-v13, we have to explicitly exclude pg_subscription.subslotname
and pg_subscription_rel.srsublsn from the checks, since they are
mismarked.  (Even if we change our mind about applying BKI_FORCE_NULL
in the branch tips, it doesn't seem wise to have assertions that
would fire in existing databases.)

Discussion: https://postgr.es/m/298837.1595196283@sss.pgh.pa.us

Branch
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/fb71329ad6fcd81dd3fcfb1f21308ccb64f7a834

Modified Files
--------------
src/backend/catalog/indexing.c | 57 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 57 insertions(+)



view thread (5+ messages)

Message-ID: <E1jxvHm-0002KM-Do@gemulon.postgresql.org>
Permalink:  ../E1jxvHm-0002KM-Do@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1jxvHm-0002KM-Do@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: Assert that we don't insert nulls into attnotnull catalog column
  In-Reply-To: <E1jxvHm-0002KM-Do@gemulon.postgresql.org>
  References: <E1jxvHm-0002KM-Do@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