pgsql: Fix possible crash with GENERATED ALWAYS columns

From: David Rowley <drowley(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix possible crash with GENERATED ALWAYS columns
Date: 2020-04-18 02:11:04
Message-ID: E1jPcwi-0004A0-CK@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix possible crash with GENERATED ALWAYS columns

In some corner cases, this could also lead to corrupted values being
included in the tuple.

Users who are concerned that they are affected by this should first
upgrade and then perform a base backup of their database and restore onto
an off-line server. They should then query each table with generated
columns to ensure there are no rows where the generated expression does
not match a newly calculated version of the GENERATED ALWAYS expression.
If no crashes occur and no rows are returned then you're not affected.

Fixes bug #16369.

Reported-by: Cameron Ezell
Discussion: https://postgr.es/m/16369-5845a6f1bef59884@postgresql.org
Backpatch-through: 12 (where GENERATED ALWAYS columns were added.)

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/3cb02e307e350caf3c9099c6f661a95fd00e7e4c

Modified Files
--------------
src/backend/executor/nodeModifyTable.c | 7 +++++++
src/test/regress/expected/generated.out | 12 ++++++++++++
src/test/regress/sql/generated.sql | 7 +++++++
3 files changed, 26 insertions(+)

Browse pgsql-committers by date

  From Date Subject
Next Message David Rowley 2020-04-18 02:11:49 pgsql: Fix possible crash with GENERATED ALWAYS columns
Previous Message Tom Lane 2020-04-18 00:50:52 pgsql: Doc: revise formatting of function/operator tables.