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 rang

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 mailto:david.g.johns...@gmail.com>>wrote: On Friday, February 24, 2017, Tom Lane mailto:t...@sss.pgh.pa.us>> wrote: Justin Pryzby writes: > Is this expected behavior ? >

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; >> > ERROR: 22003: integer out of range >> >

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 > > Yes. The provided operation is "convert a bitstring of

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 provided operation is "convert a bitstring o

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 "guess whether it's ok

[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