pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix CREATE TABLE / LIKE with bigint identity column
2+ messages / 1 participants
[nested] [flat]

* pgsql: Fix CREATE TABLE / LIKE with bigint identity column
@ 2018-03-13 14:21 Peter Eisentraut <peter_e@gmx.net>
  0 siblings, 0 replies; 2+ messages in thread

From: Peter Eisentraut @ 2018-03-13 14:21 UTC (permalink / raw)
  To: pgsql-committers

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>

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(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: Fix CREATE TABLE / LIKE with bigint identity column
@ 2018-03-13 14:21 Peter Eisentraut <peter_e@gmx.net>
  0 siblings, 0 replies; 2+ messages in thread

From: Peter Eisentraut @ 2018-03-13 14:21 UTC (permalink / raw)
  To: pgsql-committers

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>

Branch
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/c32f44c4a5b27f5055600db1a7374a898f3681df

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(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2018-03-13 14:21 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-03-13 14:21 pgsql: Fix CREATE TABLE / LIKE with bigint identity column Peter Eisentraut <peter_e@gmx.net>
2018-03-13 14:21 pgsql: Fix CREATE TABLE / LIKE with bigint identity column Peter Eisentraut <peter_e@gmx.net>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox