pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Dunstan <andrew@dunslane.net>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Don't set a fast default for anything but a plain table
Date: Fri, 18 Jun 2021 11:54:39 +0000
Message-ID: <E1luD55-0001Lt-8W@gemulon.postgresql.org> (raw)

Don't set a fast default for anything but a plain table

The fast default code added in Release 11 omitted to check that the
table a fast default was being added to was a plain table. Thus one
could be added to a foreign table, which predicably blows up. Here we
perform that check.

In addition, on the back branches, since some of these might have
escaped into the wild, if we encounter a missing value for
an attribute of something other than a plain table we ignore it.

Fixes bug #17056

Backpatch to release 11,

Reviewed by: Andres Freund, Álvaro Herrera and Tom Lane

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/5b6b5e5ee598ced2dc8e1d08a34d499860a4d15b

Modified Files
--------------
src/backend/catalog/heap.c                 | 10 +++++++++-
src/backend/commands/tablecmds.c           |  5 +++--
src/backend/utils/cache/relcache.c         | 19 ++++++++++++++++++-
src/test/regress/expected/fast_default.out | 19 +++++++++++++++++++
src/test/regress/sql/fast_default.sql      | 14 ++++++++++++++
5 files changed, 63 insertions(+), 4 deletions(-)



view thread (5+ messages)  latest in thread

Message-ID: <E1luD55-0001Lt-8W@gemulon.postgresql.org>
Permalink:  ../E1luD55-0001Lt-8W@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1luD55-0001Lt-8W@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: andrew@dunslane.net
  Subject: Re: pgsql: Don't set a fast default for anything but a plain table
  In-Reply-To: <E1luD55-0001Lt-8W@gemulon.postgresql.org>
  References: <E1luD55-0001Lt-8W@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