X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id D1F0A9DCC8B for ; Wed, 8 Feb 2006 21:21:33 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 99662-07 for ; Wed, 8 Feb 2006 21:21:37 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id B8C3E9DCC9D for ; Wed, 8 Feb 2006 21:21:31 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id k191LXT4021987; Wed, 8 Feb 2006 20:21:33 -0500 (EST) To: Kris Jurka cc: Mark Lewis , Ryan Li , pgsql-jdbc@postgresql.org Subject: Re: oid as long type In-reply-to: References: <20060208094744.74887.qmail@web34701.mail.mud.yahoo.com> <1139420461.11375.40.camel@archimedes> Comments: In-reply-to Kris Jurka message dated "Wed, 08 Feb 2006 13:11:38 -0500" Date: Wed, 08 Feb 2006 20:21:33 -0500 Message-ID: <21986.1139448093@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.108 required=5 tests=[AWL=0.108] X-Spam-Score: 0.108 X-Spam-Level: X-Archive-Number: 200602/62 X-Sequence-Number: 14659 Kris Jurka writes: > On Wed, 8 Feb 2006, Mark Lewis wrote: >> To maintain compatibility with existing code but still give access to >> the entire OID value space, why not map OID values >= 2**31 to negative >> numbers-- i.e. just consider them to be signed ints? > We don't always know when we're working with OIDs. If someone says > PreparedStatement.setInt() we don't know if they're passing us a mangled > OID they got from LargeObjectManager.create or if they're just passing us > an int, so we'd have to send the mangled form to the database. Does that matter? There's an implicit cast from int4 to oid on the database side, so I am not clear where the problem really comes in. regression=# select (-1)::int4::oid; oid ------------ 4294967295 (1 row) regression=# select 4294967295::oid::int4; int4 ------ -1 (1 row) regards, tom lane