pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix table rewrites that include a column without a default.
Date: Thu, 10 Oct 2019 05:19:44 +0000
Message-ID: <E1iIQrY-0005h6-SW@gemulon.postgresql.org> (raw)

Fix table rewrites that include a column without a default.

In c2fe139c201c I made ATRewriteTable() use tuple slots. Unfortunately
I did not notice that columns can be added in a rewrite that do not
have a default, when another column is added/altered requiring one.

Initialize columns to NULL again, and add tests.

Bug: #16038
Reported-By: anonymous
Author: Andres Freund
Discussion: https://postgr.es/m/16038-5c974541f2bf6749@postgresql.org
Backpatch: 12, where the bug was introduced in c2fe139c201c

Branch
------
REL_12_STABLE

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

Modified Files
--------------
src/backend/commands/tablecmds.c          | 10 +++++++
src/test/regress/expected/alter_table.out | 47 ++++++++++++++++++++++++++++++
src/test/regress/sql/alter_table.sql      | 48 +++++++++++++++++++++++++++++++
3 files changed, 105 insertions(+)



view thread (7+ messages)  latest in thread

Message-ID: <E1iIQrY-0005h6-SW@gemulon.postgresql.org>
Permalink:  ../E1iIQrY-0005h6-SW@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1iIQrY-0005h6-SW@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: andres@anarazel.de, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Fix table rewrites that include a column without a default.
  In-Reply-To: <E1iIQrY-0005h6-SW@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