pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Daniel Gustafsson <dgustafsson@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add SysCacheGetAttrNotNull for guaranteed not-null attrs
Date: Sat, 25 Mar 2023 21:55:35 +0000
Message-ID: <E1pgBrK-005NxA-N6@gemulon.postgresql.org> (raw)

Add SysCacheGetAttrNotNull for guaranteed not-null attrs

When extracting an attr from a cached tuple in the syscache with
SysCacheGetAttr the isnull parameter must be checked in case the
attr cannot be NULL.  For cases when this is known beforehand, a
wrapper is introduced which perform the errorhandling internally
on behalf of the caller, invoking an elog in case of a NULL attr.

Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Reviewed-by: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Reviewed-by: David Rowley <dgrowleyml@gmail.com>
Discussion: https://postgr.es/m/AD76405E-DB45-46B6-941F-17B1EB3A9076@yesql.se

Branch
------
master

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

Modified Files
--------------
src/backend/access/brin/brin_inclusion.c    |   7 +-
src/backend/access/brin/brin_minmax.c       |   7 +-
src/backend/access/brin/brin_minmax_multi.c |   7 +-
src/backend/access/index/indexam.c          |   6 +-
src/backend/catalog/aclchk.c                |  38 +++------
src/backend/catalog/index.c                 |  20 ++---
src/backend/catalog/objectaddress.c         |  23 ++----
src/backend/catalog/pg_constraint.c         |  33 +++-----
src/backend/catalog/pg_proc.c               |  25 ++----
src/backend/catalog/pg_subscription.c       |  32 +++-----
src/backend/commands/collationcmds.c        |  23 ++----
src/backend/commands/dbcommands.c           |  11 +--
src/backend/commands/indexcmds.c            |   7 +-
src/backend/commands/matview.c              |   9 +--
src/backend/commands/subscriptioncmds.c     |  10 +--
src/backend/commands/tablecmds.c            |  27 ++-----
src/backend/commands/typecmds.c             |   8 +-
src/backend/executor/execReplication.c      |   6 +-
src/backend/executor/functions.c            |   7 +-
src/backend/optimizer/util/clauses.c        |  23 +-----
src/backend/parser/parse_func.c             |   7 +-
src/backend/parser/parse_utilcmd.c          |  30 +++----
src/backend/partitioning/partbounds.c       |   9 +--
src/backend/statistics/extended_stats.c     |   5 +-
src/backend/utils/adt/amutils.c             |   5 +-
src/backend/utils/adt/pg_locale.c           |  19 ++---
src/backend/utils/adt/ruleutils.c           | 121 +++++++++-------------------
src/backend/utils/cache/lsyscache.c         |  21 ++---
src/backend/utils/cache/partcache.c         |  10 +--
src/backend/utils/cache/syscache.c          |  27 +++++++
src/backend/utils/fmgr/fmgr.c               |  39 +++------
src/backend/utils/fmgr/funcapi.c            |  25 ++----
src/backend/utils/init/postinit.c           |   9 +--
src/include/utils/syscache.h                |   3 +
src/pl/plperl/plperl.c                      |   6 +-
src/pl/plpgsql/src/pl_comp.c                |   6 +-
src/pl/plpython/plpy_procedure.c            |   6 +-
src/pl/tcl/pltcl.c                          |   7 +-
38 files changed, 232 insertions(+), 452 deletions(-)



Message-ID: <E1pgBrK-005NxA-N6@gemulon.postgresql.org>
Permalink:  ../E1pgBrK-005NxA-N6@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1pgBrK-005NxA-N6@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 using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: dgustafsson@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Add SysCacheGetAttrNotNull for guaranteed not-null attrs
  In-Reply-To: <E1pgBrK-005NxA-N6@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