aboutsummaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2020-07-21 12:38:08 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2020-07-21 12:38:08 -0400
commit3e66019f15549d3e1e13da665b2549684061d630 (patch)
tree1d809a7ba990dfc21af24c3f46071d338ed58045 /doc/src
parentc273d9d8ce412a475082b1729462845d2abb5ae8 (diff)
downloadpostgresql-3e66019f15549d3e1e13da665b2549684061d630.tar.gz
postgresql-3e66019f15549d3e1e13da665b2549684061d630.zip
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
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/bki.sgml5
1 files changed, 1 insertions, 4 deletions
diff --git a/doc/src/sgml/bki.sgml b/doc/src/sgml/bki.sgml
index 6776c4a3c18..4e7568f5ce9 100644
--- a/doc/src/sgml/bki.sgml
+++ b/doc/src/sgml/bki.sgml
@@ -122,10 +122,7 @@
if they are fixed-width and are not preceded by any nullable column.
Where this rule is inadequate, you can force correct marking by using
<literal>BKI_FORCE_NOT_NULL</literal>
- and <literal>BKI_FORCE_NULL</literal> annotations as needed. But note
- that <literal>NOT NULL</literal> constraints are only enforced in the
- executor, not against tuples that are generated by random C code,
- so care is still needed when manually creating or updating catalog rows.
+ and <literal>BKI_FORCE_NULL</literal> annotations as needed.
</para>
<para>