pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Andrew Gierth <andrew@tao11.riddles.org.uk>
Cc: evgeni-klimov@yandex.ru
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15096: Unable to CREATE TABLE LIKE with bigint identity column
Date: Thu, 8 Mar 2018 17:08:58 +0900
Message-ID: <20180308080858.GE1788@paquier.xyz> (raw)
In-Reply-To: <d9f1443c-9006-3705-1e1b-7b65301dae42@2ndquadrant.com>
References: <152009601619.21242.262498029671910378@wrigleys.postgresql.org>
	<31194.1520098424@sss.pgh.pa.us>
	<87po4lkkaj.fsf@news-spur.riddles.org.uk>
	<20180304235654.GA32165@paquier.xyz>
	<87lgf7l6sj.fsf@news-spur.riddles.org.uk>
	<21016.1520228672@sss.pgh.pa.us>
	<20180305061325.GF2266@paquier.xyz>
	<26456.1520278713@sss.pgh.pa.us>
	<d9f1443c-9006-3705-1e1b-7b65301dae42@2ndquadrant.com>

On Wed, Mar 07, 2018 at 03:16:44PM -0500, Peter Eisentraut wrote:
> Here is a patch that fixes this bug, and a second patch (not for
> backpatching) that changes the Value node to use int instead of long.

Thanks Peter for diving in.  Patch 1 looks fine to me.

Here are some comments for patch 2.

+       if (endptr != token + length || errno == ERANGE ||
+           /* check for overflow of int4 */
+           val != (long) ((int32) val))
            return T_Float;
It would be nice to have this check be consistent with the new
definition of ival and int32, One suggestion is to use directly int32 or
just have a static assertion that sizeof(int) == sizeof(int32)?  Or
that's too much nannyism?

By the way, why do you remove HAVE_LONG_INT_64?  On platforms where long
is 4 bytes this would still be a no-op.  If you care about those, you
could also remove the ones in interval.c and datetime.c...

The comment block on top of the definition of Value in value.h still
mentions "long", while it should mention "int" per your patch.  
--
Michael

Attachments:

  signature.asc (application/pgp-signature, 832B) download

view thread (13+ messages)  latest in thread

Message-ID: <20180308080858.GE1788@paquier.xyz>
Permalink:  ../20180308080858.GE1788@paquier.xyz/
Also on:    postgresql.org/message-id/20180308080858.GE1788@paquier.xyz

 · 

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-bugs@postgresql.org
  Cc: michael@paquier.xyz, peter.eisentraut@2ndquadrant.com, tgl@sss.pgh.pa.us, andrew@tao11.riddles.org.uk, evgeni-klimov@yandex.ru
  Subject: Re: BUG #15096: Unable to CREATE TABLE LIKE with bigint identity column
  In-Reply-To: <20180308080858.GE1788@paquier.xyz>
  References: <152009601619.21242.262498029671910378@wrigleys.postgresql.org> <31194.1520098424@sss.pgh.pa.us> <87po4lkkaj.fsf@news-spur.riddles.org.uk> <20180304235654.GA32165@paquier.xyz> <87lgf7l6sj.fsf@news-spur.riddles.org.uk> <21016.1520228672@sss.pgh.pa.us> <20180305061325.GF2266@paquier.xyz> <26456.1520278713@sss.pgh.pa.us> <d9f1443c-9006-3705-1e1b-7b65301dae42@2ndquadrant.com> <20180308080858.GE1788@paquier.xyz>

* 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