pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix several DDL issues of generated columns versus inheritance
2+ messages / 1 participants
[nested] [flat]

* pgsql: Fix several DDL issues of generated columns versus inheritance
@ 2020-05-08 09:40 Peter Eisentraut <peter@eisentraut.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Peter Eisentraut @ 2020-05-08 09:40 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix several DDL issues of generated columns versus inheritance

Several combinations of generated columns and inheritance in CREATE
TABLE were not handled correctly.  Specifically:

- Disallow a child column specifying a generation expression if the
  parent column is a generated column.  The child column definition
  must be unadorned and the parent column's generation expression will
  be copied.

- Prohibit a child column of a generated parent column specifying
  default values or identity.

- Allow a child column of a not-generated parent column specifying
  itself as a generated column.  This previously did not work, but it
  was possible to arrive at the state via other means (involving ALTER
  TABLE), so it seems sensible to support it.

Add tests for each case.  Also add documentation about the rules
involving generated columns and inheritance.

Discussion:
    https://www.postgresql.org/message-id/flat/15830.1575468847%40sss.pgh.pa.us
    https://www.postgresql.org/message-id/flat/2678bad1-048f-519a-ef24-b12962f41807%40enterprisedb.com
    https://www.postgresql.org/message-id/flat/CAJvUf_u4h0DxkCMCeEKAWCuzGUTnDP-G5iVmSwxLQSXn0_FWNQ%40mai...

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/086ffddf3656fb3d24d9a73ce36cb1102e42cc90

Modified Files
--------------
doc/src/sgml/ddl.sgml                   | 26 ++++++++++++++
src/backend/commands/tablecmds.c        | 61 ++++++++++++++++++++++++++++++---
src/test/regress/expected/generated.out | 44 +++++++++++++++++++++++-
src/test/regress/sql/generated.sql      | 22 +++++++++++-
4 files changed, 146 insertions(+), 7 deletions(-)



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

* pgsql: Fix several DDL issues of generated columns versus inheritance
@ 2020-05-08 09:40 Peter Eisentraut <peter@eisentraut.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Peter Eisentraut @ 2020-05-08 09:40 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix several DDL issues of generated columns versus inheritance

Several combinations of generated columns and inheritance in CREATE
TABLE were not handled correctly.  Specifically:

- Disallow a child column specifying a generation expression if the
  parent column is a generated column.  The child column definition
  must be unadorned and the parent column's generation expression will
  be copied.

- Prohibit a child column of a generated parent column specifying
  default values or identity.

- Allow a child column of a not-generated parent column specifying
  itself as a generated column.  This previously did not work, but it
  was possible to arrive at the state via other means (involving ALTER
  TABLE), so it seems sensible to support it.

Add tests for each case.  Also add documentation about the rules
involving generated columns and inheritance.

Discussion:
    https://www.postgresql.org/message-id/flat/15830.1575468847%40sss.pgh.pa.us
    https://www.postgresql.org/message-id/flat/2678bad1-048f-519a-ef24-b12962f41807%40enterprisedb.com
    https://www.postgresql.org/message-id/flat/CAJvUf_u4h0DxkCMCeEKAWCuzGUTnDP-G5iVmSwxLQSXn0_FWNQ%40mai...

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/14751c340754af9f906a893eb87a894dea3adbc9

Modified Files
--------------
doc/src/sgml/ddl.sgml                   | 26 ++++++++++++++
src/backend/commands/tablecmds.c        | 61 ++++++++++++++++++++++++++++++---
src/test/regress/expected/generated.out | 44 +++++++++++++++++++++++-
src/test/regress/sql/generated.sql      | 22 +++++++++++-
4 files changed, 146 insertions(+), 7 deletions(-)



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


end of thread, other threads:[~2020-05-08 09:40 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-05-08 09:40 pgsql: Fix several DDL issues of generated columns versus inheritance Peter Eisentraut <peter@eisentraut.org>
2020-05-08 09:40 pgsql: Fix several DDL issues of generated columns versus inheritance Peter Eisentraut <peter@eisentraut.org>

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