Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Is this expected behavior ?

This works:

	ts=# SELECT x'0000000F'::int;
	int4|15

.. but an additional leading zero causes it to fail:

	ts=# SELECT x'00000000F'::int;
	ERROR:  22003: integer out of range
	LOCATION:  bittoint4, varbit.c:1575


|/* Check that the bit string is not too long */
|if (VARBITLEN(arg) > sizeof(result) * BITS_PER_BYTE)
|	ereport(ERROR,
|			(errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
|			 errmsg("integer out of range")));

Justin


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux