pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Kris Jurka <books@ejurka.com>
Cc: Mark Lewis <mark.lewis@mir3.com>
Cc: Ryan Li <rleeuk@yahoo.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: oid as long type
Date: Wed, 08 Feb 2006 20:21:33 -0500
Message-ID: <21986.1139448093@sss.pgh.pa.us> (raw)
In-Reply-To: <Pine.BSO.4.61.0602081300560.13208@leary.csoft.net>
References: <20060208094744.74887.qmail@web34701.mail.mud.yahoo.com>
	<Pine.BSO.4.61.0602081158340.24353@leary.csoft.net>
	<1139420461.11375.40.camel@archimedes>
	<Pine.BSO.4.61.0602081300560.13208@leary.csoft.net>

Kris Jurka <books@ejurka.com> 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



view thread (10+ messages)  latest in thread

Message-ID: <21986.1139448093@sss.pgh.pa.us>
Permalink:  ../21986.1139448093@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/21986.1139448093@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: tgl@sss.pgh.pa.us, books@ejurka.com, mark.lewis@mir3.com, rleeuk@yahoo.com
  Subject: Re: oid as long type
  In-Reply-To: <21986.1139448093@sss.pgh.pa.us>
  References: <20060208094744.74887.qmail@web34701.mail.mud.yahoo.com> <Pine.BSO.4.61.0602081158340.24353@leary.csoft.net> <1139420461.11375.40.camel@archimedes> <Pine.BSO.4.61.0602081300560.13208@leary.csoft.net> <21986.1139448093@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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