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

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: df18c51) | patch
Fix all known problems with pg_dump's handling of serial sequences
2006年8月21日 00:57:26 +0000 (00:57 +0000)
2006年8月21日 00:57:26 +0000 (00:57 +0000)
commit 2b2a50722cb1863147b4a86b3db80553f989a14c
Fix all known problems with pg_dump's handling of serial sequences
by abandoning the idea that it should say SERIAL in the dump. Instead,
dump serial sequences and column defaults just like regular ones.
Add a new backend command ALTER SEQUENCE OWNED BY to let pg_dump recreate
the sequence-to-column dependency that was formerly created "behind the
scenes" by SERIAL. This restores SERIAL to being truly "just a macro"
consisting of component operations that can be stated explicitly in SQL.
Furthermore, the new command allows sequence ownership to be reassigned,
so that old mistakes can be cleaned up.

Also, downgrade the OWNED-BY dependency from INTERNAL to AUTO, since there
is no longer any very compelling argument why the sequence couldn't be
dropped while keeping the column. (This forces initdb, to be sure the
right kinds of dependencies are in there.)

Along the way, add checks to prevent ALTER OWNER or SET SCHEMA on an
owned sequence; you can now only do this indirectly by changing the
owning table's owner or schema. This is an oversight in previous
releases, but probably not worth back-patching.
29 files changed:
doc/src/sgml/datatype.sgml diff | blob | blame | history
doc/src/sgml/func.sgml diff | blob | blame | history
doc/src/sgml/ref/alter_sequence.sgml diff | blob | blame | history
doc/src/sgml/ref/alter_table.sgml diff | blob | blame | history
doc/src/sgml/ref/create_sequence.sgml diff | blob | blame | history
doc/src/sgml/ref/drop_sequence.sgml diff | blob | blame | history
src/backend/catalog/pg_depend.c diff | blob | blame | history
src/backend/catalog/pg_shdepend.c diff | blob | blame | history
src/backend/commands/sequence.c diff | blob | blame | history
src/backend/commands/tablecmds.c diff | blob | blame | history
src/backend/commands/view.c diff | blob | blame | history
src/backend/nodes/copyfuncs.c diff | blob | blame | history
src/backend/nodes/equalfuncs.c diff | blob | blame | history
src/backend/nodes/makefuncs.c diff | blob | blame | history
src/backend/nodes/outfuncs.c diff | blob | blame | history
src/backend/parser/analyze.c diff | blob | blame | history
src/backend/parser/gram.y diff | blob | blame | history
src/backend/utils/adt/ruleutils.c diff | blob | blame | history
src/bin/pg_dump/pg_dump.c diff | blob | blame | history
src/bin/pg_dump/pg_dump.h diff | blob | blame | history
src/include/catalog/catversion.h diff | blob | blame | history
src/include/catalog/dependency.h diff | blob | blame | history
src/include/nodes/makefuncs.h diff | blob | blame | history
src/include/nodes/parsenodes.h diff | blob | blame | history
src/test/regress/expected/alter_table.out diff | blob | blame | history
src/test/regress/expected/dependency.out diff | blob | blame | history
src/test/regress/expected/namespace.out diff | blob | blame | history
src/test/regress/expected/sequence.out diff | blob | blame | history
src/test/regress/sql/dependency.sql diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

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