Re: postgres types

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: "Vladimir V(dot) Zolotych" <gsmith(at)eurocom(dot)od(dot)ua>, pgsql-admin(at)postgresql(dot)org
Subject: Re: postgres types
Date: 2000-05-08 21:37:17
Message-ID: Pine.LNX.4.21.0005080048580.442-100000@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

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(at)gmx(dot)net 75262 Uppsala
http://yi.org/peter-e/ Sweden

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Marc Wrubleski 2000-05-09 20:23:14 plpgsql cannot stat plpgsql.so
Previous Message Nicolas Huillard 2000-05-08 20:39:20 RE: rules problem