pgsql: Fix CREATE TABLE / LIKE with bigint identity column

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

pgsql: Fix CREATE TABLE / LIKE with bigint identity column

Peter Eisentraut-2
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 <[hidden email]>

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/377b5ac4845c5ffbf992ee95c32d7d16d38b9081

Modified Files
--------------
src/backend/commands/sequence.c                 | 19 +++++++++++------
src/test/regress/expected/create_table_like.out | 28 ++++++++++++-------------
src/test/regress/sql/create_table_like.sql      |  2 +-
3 files changed, 28 insertions(+), 21 deletions(-)

Previous Thread Next Thread