pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter_e@gmx.net>
To: pgsql-committers@postgresql.org
Subject: pgsql: Fix CREATE TABLE / LIKE with bigint identity column
Date: Tue, 13 Mar 2018 14:21:52 +0000
Message-ID: <E1evkoK-0006CD-Ca@gemulon.postgresql.org> (raw)

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



view thread (2+ messages)  latest in thread

Message-ID: <E1evkoK-0006CD-Ca@gemulon.postgresql.org>
Permalink:  ../E1evkoK-0006CD-Ca@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1evkoK-0006CD-Ca@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: peter_e@gmx.net
  Subject: Re: pgsql: Fix CREATE TABLE / LIKE with bigint identity column
  In-Reply-To: <E1evkoK-0006CD-Ca@gemulon.postgresql.org>
  References: <E1evkoK-0006CD-Ca@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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