pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
postgres types
3+ messages / 3 participants
[nested] [flat]

* postgres types
@ 2000-05-07 14:13 Vladimir V. Zolotych <gsmith@eurocom.od.ua>
  2000-05-07 14:39 ` Re: postgres types Bruce Momjian <pgman@candle.pha.pa.us>
  0 siblings, 1 reply; 3+ messages in thread

From: Vladimir V. Zolotych @ 2000-05-07 14:13 UTC (permalink / raw)
  To: pgsql-admin


Hello all,

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,
I'll get SIGNED integer, insn't it?

Thanks!


--
Vladimir Zolotych                         gsmith@eurocom.od.ua

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: postgres types
  2000-05-07 14:13 postgres types Vladimir V. Zolotych <gsmith@eurocom.od.ua>
@ 2000-05-07 14:39 ` Bruce Momjian <pgman@candle.pha.pa.us>
  2000-05-08 21:37   ` Re: postgres types Peter Eisentraut <peter_e@gmx.net>
  0 siblings, 1 reply; 3+ messages in thread

From: Bruce Momjian @ 2000-05-07 14:39 UTC (permalink / raw)
  To: Vladimir V. Zolotych <gsmith@eurocom.od.ua>; +Cc: pgsql-admin

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


[Charset koi8-r unsupported, filtering to ASCII...]
> 
> Hello all,
> 
> 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,
> I'll get SIGNED integer, insn't it?
> 
> Thanks!
> 
> 
> --
> Vladimir Zolotych                         gsmith@eurocom.od.ua
> 
> 


-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: postgres types
  2000-05-07 14:13 postgres types Vladimir V. Zolotych <gsmith@eurocom.od.ua>
  2000-05-07 14:39 ` Re: postgres types Bruce Momjian <pgman@candle.pha.pa.us>
@ 2000-05-08 21:37   ` Peter Eisentraut <peter_e@gmx.net>
  0 siblings, 0 replies; 3+ messages in thread

From: Peter Eisentraut @ 2000-05-08 21:37 UTC (permalink / raw)
  To: Bruce Momjian <pgman@candle.pha.pa.us>; +Cc: Vladimir V. Zolotych <gsmith@eurocom.od.ua>; 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@gmx.net                   75262 Uppsala
http://yi.org/peter-e/            Sweden




^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2000-05-08 21:37 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2000-05-07 14:13 postgres types Vladimir V. Zolotych <gsmith@eurocom.od.ua>
2000-05-07 14:39 ` Bruce Momjian <pgman@candle.pha.pa.us>
2000-05-08 21:37   ` Peter Eisentraut <peter_e@gmx.net>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox