pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
[PATCH] Datatype of OID should be VARBINARY, not INT
4+ messages / 2 participants
[nested] [flat]

* [PATCH] Datatype of OID should be VARBINARY, not INT
@ 2000-06-16 14:43  Nissim <nissim@nksystems.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Nissim @ 2000-06-16 14:43 UTC (permalink / raw)
  To: pgsql-interfaces

The datatype returned by the ResultSetMetaData for OID should be
VARBINARY, not INT.  Here's a patch for Field.java:

Index: src/interfaces/jdbc/org/postgresql/Field.java
===================================================================
RCS file:
/home/projects/pgsql/cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/Field.java,v
retrieving revision 1.1
diff -r1.1 Field.java
118c118
<     "int4","oid",
---
>     "int4",
129c129,130
<     "abstime","timestamp"
---
>     "abstime","timestamp",
>     "oid"
141c142
<     Types.INTEGER,Types.INTEGER,
---
>     Types.INTEGER,
152c153,154
<     Types.TIMESTAMP,Types.TIMESTAMP
---
>     Types.TIMESTAMP,Types.TIMESTAMP,
>     Types.VARBINARY



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

* Re: [PATCH] Datatype of OID should be VARBINARY, not INT
@ 2000-06-16 15:04  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Nissim <nissim@nksystems.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Tom Lane @ 2000-06-16 15:04 UTC (permalink / raw)
  To: Nissim <nissim@nksystems.com>; +Cc: pgsql-interfaces

Nissim <nissim@nksystems.com> writes:
> The datatype returned by the ResultSetMetaData for OID should be
> VARBINARY, not INT.

Uh, why?  There's nothing VAR about it that I can see, and it is
the same size as INT ... at the moment anyway ...

			regards, tom lane



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

* Re: [PATCH] Datatype of OID should be VARBINARY, not INT
@ 2000-06-16 17:56  Nissim <nissim@nksystems.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 4+ messages in thread

From: Nissim @ 2000-06-16 17:56 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-interfaces

Tom Lane wrote:
> 
> Nissim <nissim@nksystems.com> writes:
> > The datatype returned by the ResultSetMetaData for OID should be
> > VARBINARY, not INT.
> 
> Uh, why?  There's nothing VAR about it that I can see, and it is
> the same size as INT ... at the moment anyway ...
> 
>                         regards, tom lane

If you're using it to identify rows then it is used like an int, but if
you're using it to point to a Large Object, the LO is variable size
binary data, right?

We're using it with village: http://www.working-dogs.com/village which
decides which set method of the PreparedStatement to use, based on the
type in the MetaData. If the type returned is INTEGER then it does
setInt, and if the type is BINARY or VARBINARY it does setBytes.  Do you
have a better solution than making the change I sent in the patch?

Will returning VARBINARY as the type of an OID column break anyone elses
apps?

	-Nissim



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

* Re: [PATCH] Datatype of OID should be VARBINARY, not INT
@ 2000-06-16 18:23  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Nissim <nissim@nksystems.com>
  0 siblings, 0 replies; 4+ messages in thread

From: Tom Lane @ 2000-06-16 18:23 UTC (permalink / raw)
  To: Nissim <nissim@nksystems.com>; +Cc: pgsql-interfaces

Nissim <nissim@nksystems.com> writes:
> Tom Lane wrote:
>> 
>> Nissim <nissim@nksystems.com> writes:
>>>> The datatype returned by the ResultSetMetaData for OID should be
>>>> VARBINARY, not INT.
>> 
>> Uh, why?  There's nothing VAR about it that I can see, and it is
>> the same size as INT ... at the moment anyway ...

> If you're using it to identify rows then it is used like an int, but if
> you're using it to point to a Large Object, the LO is variable size
> binary data, right?

The LO may be, but that doesn't make the OID so.  I think you are
confusing two things that should be kept separate.

> Will returning VARBINARY as the type of an OID column break anyone elses
> apps?

Undoubtedly.  Find another way.

			regards, tom lane



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


end of thread, other threads:[~2000-06-16 18:23 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2000-06-16 14:43 [PATCH] Datatype of OID should be VARBINARY, not INT Nissim <nissim@nksystems.com>
2000-06-16 15:04 ` Tom Lane <tgl@sss.pgh.pa.us>
2000-06-16 17:56   ` Nissim <nissim@nksystems.com>
2000-06-16 18:23     ` Tom Lane <tgl@sss.pgh.pa.us>

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