I tried to initialize a table with values for smallint columns.
The final goal is to get mask values for logical operations.
The insert failed with ERROR: smallint out of range.
the same occurs when using a simple select statement like:
select -32768::smallint;
select -2147483648::int;
select -9223372036854775808::bigint;
These limit values are taken from the documentation 8.1.1 Integer Types
This occurs on PG16.2 on Windows or Linux (64bit).
This prevents me to enter the binary value 0b10000000_00000000 into a smallint column
(I could use some other tricks, but this is ugly!)
-----------
postgres=# select version ();
version
----------------------------------------------------------------------------------------------------------
PostgreSQL 16.2 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 14.0.1 20240411 (Red Hat 14.0.1-0), 64-bit
(1 Zeile)
postgres=# select -32768::smallint;
ERROR: smallint out of range
Thank you for looking
Hans Buschmann