2

There is an existing question about why there is no unsigned integer (32 bit) and the answer was because it is not an SQL standard and the solution was using domain. Basically the answer was using a 32-bit signed integer and restricting it to a 16-bit unsigned integer range.

But what if I want an unsigned long integer (64 bit)? There do not seem to exist int9 or int16.

create domain uint8 as int16 check(value>=0 and value<18446744073709551615)

ERROR: type "int16" does not exist
SQL state: 42704

1
  • 3
    18446744073709551615 doesn't fit in a bigint, so you will have to use numeric Commented Nov 27, 2020 at 15:22

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.