pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tomas Vondra <tomas.vondra@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Check syscache result in AlterStatistics
Date: Sun, 23 Jan 2022 02:22:39 +0000
Message-ID: <E1nBSWd-00080r-7D@gemulon.postgresql.org> (raw)

Check syscache result in AlterStatistics

The syscache lookup may return NULL even for valid OID, for example due
to a concurrent DROP STATISTICS, so a HeapTupleIsValid is necessary.
Without it, it may fail with a segfault.

Reported by Alexander Lakhin, patch by me. Backpatch to 13, where ALTER
STATISTICS ... SET STATISTICS was introduced.

Backpatch-through: 13
Discussion: https://postgr.es/m/17372-bf3b6e947e35ae77%40postgresql.org

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/267ccc38ba6a95889d98959f183de64ceff23087

Modified Files
--------------
src/backend/commands/statscmds.c | 2 ++
1 file changed, 2 insertions(+)



view thread (3+ messages)  latest in thread

Message-ID: <E1nBSWd-00080r-7D@gemulon.postgresql.org>
Permalink:  ../E1nBSWd-00080r-7D@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1nBSWd-00080r-7D@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: tomas.vondra@postgresql.org
  Subject: Re: pgsql: Check syscache result in AlterStatistics
  In-Reply-To: <E1nBSWd-00080r-7D@gemulon.postgresql.org>
  References: <E1nBSWd-00080r-7D@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