Re: BUG #15096: Unable to CREATE TABLE LIKE with bigint identitycolumn - Mailing list pgsql-bugs

From Peter Eisentraut
Subject Re: BUG #15096: Unable to CREATE TABLE LIKE with bigint identitycolumn
Date
Msg-id ad522dc9-bbcd-3567-d64e-d4f261b68b08@2ndquadrant.com
Whole thread Raw
In response to Re: BUG #15096: Unable to CREATE TABLE LIKE with bigint identitycolumn  (Michael Paquier <michael@paquier.xyz>)
Responses Re: BUG #15096: Unable to CREATE TABLE LIKE with bigint identitycolumn  (Michael Paquier <michael@paquier.xyz>)
List pgsql-bugs
On 3/8/18 03:08, Michael Paquier wrote:
> 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?

Fixed in the attached next version.

> 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.

Right, but the compiler can optimize it away then.  No need to have #ifdefs.

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

done

> If you care about those, you
> could also remove the ones in interval.c and datetime.c...

Actually, we could just use the strtoint() defined there and apply it
everywhere, so avoid repeating these patterns.  Done so in an additional
patch.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment

pgsql-bugs by date:

Previous
From: Félix GERZAGUET
Date:
Subject: Re: BUG #15107: No good plans when row-level security is enabled
Next
From: Tom Lane
Date:
Subject: Re: BUG #15106: The AFTER trigger is created separately on view, and the DML operation can not trigger the trigger