Why unsigned integer is not available in PostgreSQL?

Adrian Hoe picture Adrian Hoe · Dec 28, 2013 · Viewed 67.8k times · Source

I came across this post (What is the difference between tinyint, smallint, mediumint, bigint and int in MySQL?) and realized that PostgreSQL does not support unsigned integer.

Can anyone help to explain why is it so?

Most of the time, I use unsigned integer as auto incremented primary key in MySQL. In such design, how can I overcome this when I port my database from MySQL to PostgreSQL?

Thanks.

Answer

Peter Eisentraut picture Peter Eisentraut · Dec 31, 2013

It's not in the SQL standard, so the general urge to implement it is lower.

Having too many different integer types makes the type resolution system more fragile, so there is some resistance to adding more types into the mix.

That said, there is no reason why it couldn't be done. It's just a lot of work.