From: | Peter Eisentraut <peter(at)eisentraut(dot)org> |
---|---|
To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
Subject: | pgsql: Generated columns |
Date: | 2019-03-30 07:25:44 |
Message-ID: | E1hA8N6-0001L3-6a@gemulon.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
Generated columns
This is an SQL-standard feature that allows creating columns that are
computed from expressions rather than assigned, similar to a view or
materialized view but on a column basis.
This implements one kind of generated column: stored (computed on
write). Another kind, virtual (computed on read), is planned for the
future, and some room is left for it.
Reviewed-by: Michael Paquier <michael(at)paquier(dot)xyz>
Reviewed-by: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Discussion: https://www.postgresql.org/message-id/flat/b151f851-4019-bdb1-699e-ebab07d2f40a(at)2ndquadrant(dot)com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/fc22b6623b6b3bab3cb057ccd282c2bfad1a0b30
Modified Files
--------------
contrib/postgres_fdw/expected/postgres_fdw.out | 25 +
contrib/postgres_fdw/postgres_fdw.c | 3 +-
contrib/postgres_fdw/sql/postgres_fdw.sql | 14 +
doc/src/sgml/catalogs.sgml | 19 +-
doc/src/sgml/ddl.sgml | 118 ++++
doc/src/sgml/information_schema.sgml | 66 +-
doc/src/sgml/protocol.sgml | 4 +-
doc/src/sgml/ref/copy.sgml | 3 +-
doc/src/sgml/ref/create_foreign_table.sgml | 27 +-
doc/src/sgml/ref/create_table.sgml | 45 +-
doc/src/sgml/ref/create_trigger.sgml | 4 +-
doc/src/sgml/textsearch.sgml | 26 +-
doc/src/sgml/trigger.sgml | 18 +
src/backend/access/common/tupdesc.c | 11 +
src/backend/catalog/heap.c | 108 +++-
src/backend/catalog/information_schema.sql | 30 +-
src/backend/commands/copy.c | 31 +-
src/backend/commands/tablecmds.c | 167 +++++-
src/backend/commands/trigger.c | 31 +-
src/backend/commands/typecmds.c | 6 +-
src/backend/executor/execMain.c | 8 +-
src/backend/executor/execReplication.c | 11 +
src/backend/executor/nodeModifyTable.c | 112 ++++
src/backend/nodes/copyfuncs.c | 2 +
src/backend/nodes/equalfuncs.c | 2 +
src/backend/nodes/outfuncs.c | 9 +
src/backend/nodes/readfuncs.c | 1 +
src/backend/optimizer/plan/createplan.c | 8 +-
src/backend/optimizer/util/inherit.c | 6 +
src/backend/optimizer/util/plancat.c | 19 +
src/backend/parser/analyze.c | 27 +
src/backend/parser/gram.y | 14 +-
src/backend/parser/parse_agg.c | 11 +
src/backend/parser/parse_expr.c | 6 +
src/backend/parser/parse_func.c | 3 +
src/backend/parser/parse_relation.c | 19 +
src/backend/parser/parse_utilcmd.c | 66 +-
src/backend/replication/logical/proto.c | 9 +-
src/backend/replication/logical/relation.c | 2 +-
src/backend/replication/logical/tablesync.c | 6 +-
src/backend/replication/logical/worker.c | 2 +-
src/backend/replication/pgoutput/pgoutput.c | 2 +-
src/backend/rewrite/rewriteHandler.c | 36 +-
src/backend/utils/cache/lsyscache.c | 33 +
src/backend/utils/cache/partcache.c | 1 +
src/backend/utils/cache/relcache.c | 4 +
src/bin/pg_dump/pg_dump.c | 40 +-
src/bin/pg_dump/pg_dump.h | 1 +
src/bin/pg_dump/pg_dump_sort.c | 10 +
src/bin/pg_dump/t/002_pg_dump.pl | 17 +
src/bin/psql/describe.c | 23 +-
src/include/access/tupdesc.h | 1 +
src/include/catalog/catversion.h | 2 +-
src/include/catalog/heap.h | 4 +-
src/include/catalog/pg_attribute.h | 5 +
src/include/catalog/pg_class.dat | 2 +-
src/include/executor/nodeModifyTable.h | 2 +
src/include/nodes/execnodes.h | 3 +
src/include/nodes/parsenodes.h | 24 +-
src/include/optimizer/plancat.h | 2 +
src/include/parser/kwlist.h | 1 +
src/include/parser/parse_node.h | 3 +-
src/include/utils/lsyscache.h | 1 +
src/pl/plperl/expected/plperl_trigger.out | 95 +++
src/pl/plperl/plperl.c | 40 +-
src/pl/plperl/sql/plperl_trigger.sql | 36 ++
src/pl/plpgsql/src/pl_exec.c | 20 +
src/pl/plpython/expected/plpython_trigger.out | 94 +++
src/pl/plpython/plpy_cursorobject.c | 5 +-
src/pl/plpython/plpy_exec.c | 23 +-
src/pl/plpython/plpy_spi.c | 3 +-
src/pl/plpython/plpy_typeio.c | 17 +-
src/pl/plpython/plpy_typeio.h | 2 +-
src/pl/plpython/sql/plpython_trigger.sql | 37 ++
src/pl/tcl/expected/pltcl_trigger.out | 99 +++
src/pl/tcl/pltcl.c | 50 +-
src/pl/tcl/sql/pltcl_trigger.sql | 36 ++
src/test/regress/expected/create_table_like.out | 46 ++
src/test/regress/expected/generated.out | 768 ++++++++++++++++++++++++
src/test/regress/parallel_schedule | 2 +-
src/test/regress/serial_schedule | 1 +
src/test/regress/sql/create_table_like.sql | 14 +
src/test/regress/sql/generated.sql | 451 ++++++++++++++
src/test/subscription/t/011_generated.pl | 65 ++
84 files changed, 3065 insertions(+), 155 deletions(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Thomas Munro | 2019-03-30 10:32:22 | Re: pgsql: Compute XID horizon for page level index vacuum on primary. |
Previous Message | Peter Eisentraut | 2019-03-30 06:17:10 | pgsql: Small code simplification for REINDEX CONCURRENTLY |