pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix usage of "tableoid" in GENERATED expressions.
3+ messages / 1 participants
[nested] [flat]

* pgsql: Fix usage of "tableoid" in GENERATED expressions.
@ 2021-05-21 19:02  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 3+ messages in thread

From: Tom Lane @ 2021-05-21 19:02 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix usage of "tableoid" in GENERATED expressions.

We consider this supported (though I've got my doubts that it's a
good idea, because tableoid is not immutable).  However, several
code paths failed to fill the field in soon enough, causing such
a GENERATED expression to see zero or the wrong value.  This
occurred when ALTER TABLE adds a new GENERATED column to a table
with existing rows, and during regular INSERT or UPDATE on a
foreign table with GENERATED columns.

Noted during investigation of a report from Vitaly Ustinov.
Back-patch to v12 where GENERATED came in.

Discussion: https://postgr.es/m/CAM_DEiWR2DPT6U4xb-Ehigozzd3n3G37ZB1+867zbsEVtYoJww@mail.gmail.com

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/77e3204ecbf15ab5dfd295bbc66eeeec4d9ade19

Modified Files
--------------
src/backend/commands/tablecmds.c        | 13 ++++++++-----
src/backend/executor/nodeModifyTable.c  | 24 ++++++++++++++++++------
src/test/regress/expected/generated.out | 13 ++++++++-----
src/test/regress/sql/generated.sql      |  5 ++++-
4 files changed, 38 insertions(+), 17 deletions(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* pgsql: Fix usage of "tableoid" in GENERATED expressions.
@ 2021-05-21 19:02  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 3+ messages in thread

From: Tom Lane @ 2021-05-21 19:02 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix usage of "tableoid" in GENERATED expressions.

We consider this supported (though I've got my doubts that it's a
good idea, because tableoid is not immutable).  However, several
code paths failed to fill the field in soon enough, causing such
a GENERATED expression to see zero or the wrong value.  This
occurred when ALTER TABLE adds a new GENERATED column to a table
with existing rows, and during regular INSERT or UPDATE on a
foreign table with GENERATED columns.

Noted during investigation of a report from Vitaly Ustinov.
Back-patch to v12 where GENERATED came in.

Discussion: https://postgr.es/m/CAM_DEiWR2DPT6U4xb-Ehigozzd3n3G37ZB1+867zbsEVtYoJww@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/2b0ee126bbf01cbfd657bd53c94f9284ba903ca2

Modified Files
--------------
src/backend/commands/tablecmds.c        | 13 ++++++++-----
src/backend/executor/nodeModifyTable.c  | 24 ++++++++++++++++++------
src/test/regress/expected/generated.out | 13 ++++++++-----
src/test/regress/sql/generated.sql      |  5 ++++-
4 files changed, 38 insertions(+), 17 deletions(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* pgsql: Fix usage of "tableoid" in GENERATED expressions.
@ 2021-05-21 19:02  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 3+ messages in thread

From: Tom Lane @ 2021-05-21 19:02 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix usage of "tableoid" in GENERATED expressions.

We consider this supported (though I've got my doubts that it's a
good idea, because tableoid is not immutable).  However, several
code paths failed to fill the field in soon enough, causing such
a GENERATED expression to see zero or the wrong value.  This
occurred when ALTER TABLE adds a new GENERATED column to a table
with existing rows, and during regular INSERT or UPDATE on a
foreign table with GENERATED columns.

Noted during investigation of a report from Vitaly Ustinov.
Back-patch to v12 where GENERATED came in.

Discussion: https://postgr.es/m/CAM_DEiWR2DPT6U4xb-Ehigozzd3n3G37ZB1+867zbsEVtYoJww@mail.gmail.com

Branch
------
REL_12_STABLE

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

Modified Files
--------------
src/backend/commands/tablecmds.c        | 13 ++++++++-----
src/backend/executor/nodeModifyTable.c  | 24 ++++++++++++++++++------
src/test/regress/expected/generated.out | 13 ++++++++-----
src/test/regress/sql/generated.sql      |  5 ++++-
4 files changed, 38 insertions(+), 17 deletions(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2021-05-21 19:02 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-05-21 19:02 pgsql: Fix usage of "tableoid" in GENERATED expressions. Tom Lane <tgl@sss.pgh.pa.us>
2021-05-21 19:02 pgsql: Fix usage of "tableoid" in GENERATED expressions. Tom Lane <tgl@sss.pgh.pa.us>
2021-05-21 19:02 pgsql: Fix usage of "tableoid" in GENERATED expressions. Tom Lane <tgl@sss.pgh.pa.us>

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