From gsmith@eurocom.od.ua Sun May 7 14:12:37 2000 Received: from Main.eurocom.od.ua (root@Main.EuroCom.Od.UA [212.15.128.6]) by hub.org (8.9.3/8.9.3) with ESMTP id KAA70529 for ; Sun, 7 May 2000 10:12:37 -0400 (EDT) (envelope-from gsmith@eurocom.od.ua) Received: from eurocom.od.ua (FarHost.EuroCom.Od.UA [212.15.128.42]) by Main.eurocom.od.ua (8.10.0/8.10.0) with ESMTP id e47ECWi13100 for ; Sun, 7 May 2000 17:12:33 +0300 Message-ID: <391579F1.27BA9A@eurocom.od.ua> Date: Sun, 07 May 2000 17:13:05 +0300 From: "Vladimir V. Zolotych" X-Mailer: Mozilla 4.51 [en] (X11; I; Linux 2.2.5-15 i686) X-Accept-Language: en MIME-Version: 1.0 To: pgsql-admin@postgresql.org Subject: postgres types Content-Type: multipart/alternative; boundary="------------9CB0AFE545F58085A641EB8E" X-Archive-Number: 200005/28 --------------9CB0AFE545F58085A641EB8E Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit 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 --------------9CB0AFE545F58085A641EB8E Content-Type: text/html; charset=koi8-r Content-Transfer-Encoding: 7bit  
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
  --------------9CB0AFE545F58085A641EB8E-- From pgman@candle.pha.pa.us Sun May 7 14:45:30 2000 Received: from candle.pha.pa.us (root@s5-03.ppp.op.net [209.152.195.67]) by hub.org (8.9.3/8.9.3) with ESMTP id KAA21116 for ; Sun, 7 May 2000 10:45:30 -0400 (EDT) (envelope-from pgman@candle.pha.pa.us) Received: (from pgman@localhost) by candle.pha.pa.us (8.9.0/8.9.0) id KAA20049; Sun, 7 May 2000 10:39:46 -0400 (EDT) From: Bruce Momjian Message-Id: <200005071439.KAA20049@candle.pha.pa.us> Subject: Re: postgres types In-Reply-To: <391579F1.27BA9A@eurocom.od.ua> from "Vladimir V. Zolotych" at "May 7, 2000 05:13:05 pm" To: "Vladimir V. Zolotych" Date: Sun, 7 May 2000 10:39:45 -0400 (EDT) CC: pgsql-admin@postgresql.org X-Mailer: ELM [version 2.4ME+ PL72 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Archive-Number: 200005/29 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 From peter_e@gmx.net Mon May 8 21:33:14 2000 Received: from merganser.its.uu.se (merganser.its.uu.se [130.238.6.236]) by hub.org (8.9.3/8.9.3) with ESMTP id RAA98020 for ; Mon, 8 May 2000 17:33:14 -0400 (EDT) (envelope-from peter@localhost.its.uu.se) Received: from regulus.student.UU.SE ([130.238.5.2]:58379 "EHLO regulus.its.uu.se") by merganser.its.uu.se with ESMTP id ; Mon, 8 May 2000 23:32:25 +0200 Received: from peter (helo=localhost) by regulus.its.uu.se with local-esmtp (Exim 3.02 #2) id 12ovDJ-0000Jg-00; Mon, 08 May 2000 23:37:17 +0200 Date: Mon, 8 May 2000 23:37:17 +0200 (CEST) From: Peter Eisentraut To: Bruce Momjian cc: "Vladimir V. Zolotych" , pgsql-admin@postgresql.org Subject: Re: postgres types In-Reply-To: <200005071439.KAA20049@candle.pha.pa.us> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT X-Archive-Number: 200005/33 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