RE: Is there unsigned datatype in PostgreSQL?

Поиск
Список
Период
Сортировка
От Robby Slaughter
Тема RE: Is there unsigned datatype in PostgreSQL?
Дата
Msg-id EPEHLKLEHAHLONFOKNHNMEAJDDAA.webmaster@robbyslaughter.com
обсуждение исходный текст
Ответ на Is there unsigned datatype in PostgreSQL?  (Carfield Yim <mailing@desktop.carfield.com.hk>)
Список pgsql-novice
Carfield,

Nope, there's not a native data type which is unsigned.

You could use the OID datatype, but that would be inelegant
and not very portable.

You could also use the NUMERIC data type and just use the
minimal number of points of precision, but that would
be inelegant and slower.

You can use a character field CHAR(x) with the number
of digits you want.

You can always go up to he next biggest INTEGER type.
(Numbers larger than 32,768? Go to INT4. Larger than 2 billion?
Go to INT 8. Larger than 4 x 10 ^ 18? Uh...(what are you
counting again?)

You could also just change your supporting to code to automatically
subtract the smallest negative number so that you effectively
get only positives.

HTH

-Robby

-----Original Message-----
From: pgsql-novice-owner@postgresql.org
[mailto:pgsql-novice-owner@postgresql.org]On Behalf Of Carfield Yim
Sent: Wednesday, July 18, 2001 12:48 PM
To: pgsql-novice@postgresql.org
Subject: [NOVICE] Is there unsigned datatype in PostgreSQL?


Is there unsigned datatype like unsigned int?

--



Carfield Yim, visit my homepage at http://www.carfield.com.hk


---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

В списке pgsql-novice по дате отправления:

Предыдущее
От: Carfield Yim
Дата:
Сообщение: Is there unsigned datatype in PostgreSQL?
Следующее
От: Henry House
Дата:
Сообщение: Re: Is there unsigned datatype in PostgreSQL?