]> granicus.if.org Git - postgresql/commit
Identity columns
authorPeter Eisentraut <peter_e@gmx.net>
Thu, 6 Apr 2017 12:33:16 +0000 (08:33 -0400)
committerPeter Eisentraut <peter_e@gmx.net>
Thu, 6 Apr 2017 12:41:37 +0000 (08:41 -0400)
commit3217327053638085d24dd4d276e7c1f7ac2c4c6b
tree513d1264a2935b05e28b0d8322d73a0411a3d02f
parent6bad580d9e678a0b604883e14d8401d469b06566
Identity columns

This is the SQL standard-conforming variant of PostgreSQL's serial
columns.  It fixes a few usability issues that serial columns have:

- CREATE TABLE / LIKE copies default but refers to same sequence
- cannot add/drop serialness with ALTER TABLE
- dropping default does not drop sequence
- need to grant separate privileges to sequence
- other slight weirdnesses because serial is some kind of special macro

Reviewed-by: Vitaly Burovoy <vitaly.burovoy@gmail.com>
57 files changed:
doc/src/sgml/catalogs.sgml
doc/src/sgml/information_schema.sgml
doc/src/sgml/ref/alter_table.sgml
doc/src/sgml/ref/copy.sgml
doc/src/sgml/ref/create_table.sgml
doc/src/sgml/ref/insert.sgml
src/backend/access/common/tupdesc.c
src/backend/catalog/dependency.c
src/backend/catalog/genbki.pl
src/backend/catalog/heap.c
src/backend/catalog/index.c
src/backend/catalog/information_schema.sql
src/backend/catalog/pg_depend.c
src/backend/catalog/sql_features.txt
src/backend/commands/sequence.c
src/backend/commands/tablecmds.c
src/backend/executor/execExpr.c
src/backend/executor/execExprInterp.c
src/backend/nodes/copyfuncs.c
src/backend/nodes/equalfuncs.c
src/backend/nodes/nodeFuncs.c
src/backend/nodes/outfuncs.c
src/backend/nodes/readfuncs.c
src/backend/parser/analyze.c
src/backend/parser/gram.y
src/backend/parser/parse_utilcmd.c
src/backend/rewrite/rewriteHandler.c
src/backend/utils/adt/ruleutils.c
src/backend/utils/cache/lsyscache.c
src/backend/utils/cache/relcache.c
src/backend/utils/errcodes.txt
src/bin/pg_dump/pg_dump.c
src/bin/pg_dump/pg_dump.h
src/bin/pg_dump/t/002_pg_dump.pl
src/bin/psql/describe.c
src/bin/psql/tab-complete.c
src/include/catalog/catversion.h
src/include/catalog/dependency.h
src/include/catalog/pg_attribute.h
src/include/catalog/pg_class.h
src/include/commands/sequence.h
src/include/executor/execExpr.h
src/include/nodes/nodes.h
src/include/nodes/parsenodes.h
src/include/nodes/primnodes.h
src/include/parser/kwlist.h
src/include/utils/lsyscache.h
src/test/regress/expected/create_table_like.out
src/test/regress/expected/identity.out [new file with mode: 0644]
src/test/regress/expected/sequence.out
src/test/regress/expected/truncate.out
src/test/regress/parallel_schedule
src/test/regress/serial_schedule
src/test/regress/sql/create_table_like.sql
src/test/regress/sql/identity.sql [new file with mode: 0644]
src/test/regress/sql/sequence.sql
src/test/regress/sql/truncate.sql