Re: [GENERAL] SELECT x'00000000F'::int leading zeros causes "integer out of range"

2017-02-24 Thread Gavan Schneider
On 2/25/17 at 6:56 AM, Gavin Flower wrote: On 25/02/17 08:39, John McKown wrote: On Fri, Feb 24, 2017 at 1:25 PM, David G. Johnston On Friday, February 24, 2017, Tom Lane wrote: Justin Pryzby writes: Is this expected behavior ? ts=# SELECT x'F'::int; ERROR: 22003: integer out of

Re: [GENERAL] SELECT x'00000000F'::int leading zeros causes "integer out of range"

2017-02-24 Thread Gavin Flower
On 25/02/17 08:39, John McKown wrote: On Fri, Feb 24, 2017 at 1:25 PM, David G. Johnston >wrote: On Friday, February 24, 2017, Tom Lane > wrote: Justin Pryzby

Re: [GENERAL] SELECT x'00000000F'::int leading zeros causes "integer out of range"

2017-02-24 Thread John McKown
On Fri, Feb 24, 2017 at 1:25 PM, David G. Johnston < david.g.johns...@gmail.com> wrote: > On Friday, February 24, 2017, Tom Lane wrote: > >> Justin Pryzby writes: >> > Is this expected behavior ? >> > ts=# SELECT x'F'::int; >> >

Re: [GENERAL] SELECT x'00000000F'::int leading zeros causes "integer out of range"

2017-02-24 Thread David G. Johnston
On Friday, February 24, 2017, Tom Lane wrote: > Justin Pryzby > writes: > > Is this expected behavior ? > > ts=# SELECT x'F'::int; > > ERROR: 22003: integer out of range > > LOCATION: bittoint4, varbit.c:1575 > >

Re: [GENERAL] SELECT x'00000000F'::int leading zeros causes "integer out of range"

2017-02-24 Thread Melvin Davidson
On Fri, Feb 24, 2017 at 2:13 PM, Tom Lane wrote: > Justin Pryzby writes: > > Is this expected behavior ? > > ts=# SELECT x'F'::int; > > ERROR: 22003: integer out of range > > LOCATION: bittoint4, varbit.c:1575 > > Yes. The

Re: [GENERAL] SELECT x'00000000F'::int leading zeros causes "integer out of range"

2017-02-24 Thread Tom Lane
Justin Pryzby writes: > Is this expected behavior ? > ts=# SELECT x'F'::int; > ERROR: 22003: integer out of range > LOCATION: bittoint4, varbit.c:1575 Yes. The provided operation is "convert a bitstring of up to 32 bits to an integer". It's not

[GENERAL] SELECT x'00000000F'::int leading zeros causes "integer out of range"

2017-02-24 Thread Justin Pryzby
Is this expected behavior ? This works: ts=# SELECT x'000F'::int; int4|15 .. but an additional leading zero causes it to fail: ts=# SELECT x'F'::int; ERROR: 22003: integer out of range LOCATION: bittoint4, varbit.c:1575 |/* Check that the