]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix CREATE TABLE / LIKE with bigint identity column
authorPeter Eisentraut <peter_e@gmx.net>
Wed, 7 Mar 2018 19:38:35 +0000 (14:38 -0500)
committerPeter Eisentraut <peter_e@gmx.net>
Tue, 13 Mar 2018 13:41:36 +0000 (09:41 -0400)
commitc32f44c4a5b27f5055600db1a7374a898f3681df
tree23f38ee1de96f2ef214c0515ced16d13745c1ef2
parente2ed3c4a3002a371ceca45d1b5e5581412de4508
Fix CREATE TABLE / LIKE with bigint identity column

CREATE TABLE / LIKE with a bigint identity column would fail on
platforms where long is 32 bits.  Copying the sequence values used
makeInteger(), which would truncate the 64-bit sequence data to 32 bits.
To fix, use makeFloat() instead, like the parser.  (This does not
actually make use of floats, but stores the values as strings.)

Bug: #15096
Reviewed-by: Michael Paquier <michael@paquier.xyz>
src/backend/commands/sequence.c
src/test/regress/expected/create_table_like.out
src/test/regress/sql/create_table_like.sql