git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: ae69c4f) | patch
ALTER TABLE command to change generation expression
Thu, 4 Jan 2024 14:45:35 +0000 (15:45 +0100)
Thu, 4 Jan 2024 15:28:54 +0000 (16:28 +0100)
commit 5d06e99a3cfc23bbc217b4d78b8c070ad52f720e
ALTER TABLE command to change generation expression

This adds a new ALTER TABLE subcommand ALTER COLUMN ... SET EXPRESSION
that changes the generation expression of a generated column.

The syntax is not standard but was adapted from other SQL
implementations.

This command causes a table rewrite, using the usual ALTER TABLE
mechanisms. The implementation is similar to and makes use of some of
the infrastructure of the SET DATA TYPE subcommand (for example,
rebuilding constraints and indexes afterwards). The new command
requires a new pass in AlterTablePass, and the ADD COLUMN pass had to
be moved earlier so that combinations of ADD COLUMN and SET EXPRESSION
can work.

Author: Amul Sul <sulamul@gmail.com>
Discussion: https://www.postgresql.org/message-id/flat/CAAJ_b94yyJeGA-5M951_Lr+KfZokOp-2kXicpmEhi5FXhBeTog@mail.gmail.com
doc/src/sgml/ref/alter_table.sgml diff | blob | blame | history
src/backend/commands/tablecmds.c diff | blob | blame | history
src/backend/parser/gram.y diff | blob | blame | history
src/bin/psql/tab-complete.c diff | blob | blame | history
src/include/nodes/parsenodes.h diff | blob | blame | history
src/test/modules/test_ddl_deparse/test_ddl_deparse.c diff | blob | blame | history
src/test/regress/expected/generated.out diff | blob | blame | history
src/test/regress/sql/generated.sql diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /