Re: postgres types

Поиск
Список
Период
Сортировка
Искать
От
Peter Eisentraut
Тема
Re: postgres types
Дата
в 19:09:11
Msg-id
Pine.LNX.4.21.0005080048580.442-100000@localhost.localdomain
Ответ на
Re: postgres types (Bruce Momjian)
Список
Дерево обсуждения
postgres types "Vladimir V. Zolotych" <gsmith@eurocom.od.ua>
Re: postgres types Bruce Momjian <pgman@candle.pha.pa.us>
Re: postgres types Peter Eisentraut <peter_e@gmx.net>
Bruce Momjian writes:

> OID should be an unsigned int.  Let us know if there are any problems.

The oid type is for storing oids, not arbitrary numbers. It might happen
to do that too, but it isn't designed for it. To get unsigned numbers use
a check contraint. Then everyone knows what's going on; don't rely on the
particulars of the implementation.

Anyway ...

peter=# create table foo (a oid, b text);
CREATE
peter=# insert into foo values (-1, 'zzz');
INSERT 18730 1
peter=# select * from foo;
 a  |  b
----+-----
 -1 | zzz
(1 row)


> > Can I have UNSIGNED integer in PostgreSQL ?
> > E.g. how should I describe type of field to have
> > full range of 32 bits? If I describe filed as INT4,

int8/bigint

> > I'll get SIGNED integer, insn't it?

Per SQL, all numbers are signed.


-- 
Peter Eisentraut                  Sernanders väg 10:115
peter_e@gmx.net                   75262 Uppsala
http://yi.org/peter-e/            Sweden

В списке pgsql-admin по дате отправления
От: Nicolas Huillard
Дата:
Сообщение: RE: rules problem
От: Marc Wrubleski
Дата:
Сообщение: plpgsql cannot stat plpgsql.so
FAQ