pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
int4/int8 problem with jdbc was Re: "Fix" for INT8 literals being parsed as INT4 disqualifying
5+ messages / 3 participants
[nested] [flat]

* int4/int8 problem with jdbc was Re: "Fix" for INT8 literals being parsed as INT4 disqualifying
@ 2004-06-02 10:21 Jan Heise <jan@janheise.de>
  2004-06-02 11:16 ` Re: int4/int8 problem with jdbc was Re: "Fix" for INT8 literals Oliver Jowett <oliver@opencloud.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Jan Heise @ 2004-06-02 10:21 UTC (permalink / raw)
  To: pgsql-jdbc

hi all,

i have some problems with my java app and int8 pks. i browsed the 
mail-archives and found the
following mail thread Re: "Fix" for INT8 literals being parsed as INT4 
disqualifying
the last statement was:

That patch will be applied soon. But it will *not* be in the 7.4 stable 
branch. It will be fixed in head of tree. Since it will break existing 
code I didn't want to add it to 7.4 in the middle of beta, or now that 
7.4 is RC1.


full text of the mail i'm referring to:

http://archives.postgresql.org/pgsql-jdbc/2003-11/msg00057.php

has this been already adressed in the HEAD for the jdbc-driver? because 
i loaded it from
gborg via cvs and the problem still persists.

http://gborg.postgresql.org/project/pgjdbc/projdisplay.php


tia,

jan

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

* Re: int4/int8 problem with jdbc was Re: "Fix" for INT8 literals
  2004-06-02 10:21 int4/int8 problem with jdbc was Re: "Fix" for INT8 literals being parsed as INT4 disqualifying Jan Heise <jan@janheise.de>
@ 2004-06-02 11:16 ` Oliver Jowett <oliver@opencloud.com>
  2004-06-02 11:47   ` Re: int4/int8 problem with jdbc was Re: "Fix" for INT8 literals Jan Heise <jan@janheise.de>
  0 siblings, 1 reply; 5+ messages in thread

From: Oliver Jowett @ 2004-06-02 11:16 UTC (permalink / raw)
  To: Jan Heise <jan@janheise.de>; +Cc: pgsql-jdbc

Jan Heise wrote:
> hi all,
> 
> i have some problems with my java app and int8 pks. i browsed the 
> mail-archives and found the
> following mail thread *Re: "Fix" for INT8 literals being parsed as INT4 
> disqualifying*
> the last statement was:
> 
> That patch will be applied soon. But it will *not* be in the 7.4 stable 
> branch. It will be fixed in head of tree. Since it will break existing 
> code I didn't want to add it to 7.4 in the middle of beta, or now that 
> 7.4 is RC1.
> 
> full text of the mail i'm referring to:
> 
> http://archives.postgresql.org/pgsql-jdbc/2003-11/msg00057.php
> 
> has this been already adressed in the HEAD for the jdbc-driver? because 
> i loaded it from
> gborg via cvs and the problem still persists.

I don't believe the patch in question ever got applied.

The 7.5 server doesn't suffer from the same "type mismatch prevents use 
of an index" problem, I believe. Or you could add an explicit ::int8 
cast to your query.

My v3 protocol changes should fix this against a 7.4 server, but they're 
some distance away from making it into the official driver at the moment.

-O



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

* Re: int4/int8 problem with jdbc was Re: "Fix" for INT8 literals
  2004-06-02 10:21 int4/int8 problem with jdbc was Re: "Fix" for INT8 literals being parsed as INT4 disqualifying Jan Heise <jan@janheise.de>
  2004-06-02 11:16 ` Re: int4/int8 problem with jdbc was Re: "Fix" for INT8 literals Oliver Jowett <oliver@opencloud.com>
@ 2004-06-02 11:47   ` Jan Heise <jan@janheise.de>
  2004-06-02 13:27     ` Re: int4/int8 problem with jdbc was Re: "Fix" for INT8 literals Paul Thomas <paul@tmsl.demon.co.uk>
  0 siblings, 1 reply; 5+ messages in thread

From: Jan Heise @ 2004-06-02 11:47 UTC (permalink / raw)
  To: Oliver Jowett <oliver@opencloud.com>; +Cc: pgsql-jdbc

oliver, thanks for your reply.

the db in question is a 7.4 site in production. upgrading to another 
version is not really what i'd like
to do. the explicit cast is problematic too, i'm using hibernate as my 
orm. unless i missed something
in the docs, i can not add the cast to the config - but this is sth. 
for the hibernate forums.

the problem is a special case where i have to load objects from the 
table in question by the pk
(details would be quite long, but i can not change the table-structure 
at this time). table size is
approx. 120 million rows and approx 2 million rows have a pk < 
INT4_MAX. so i think my only
option is dropping the foreign keys, making the pks and all references 
bigger than INT4_MAX
and recreate the fk.

jan

Am 02.06.2004 um 13:16 schrieb Oliver Jowett:

> Jan Heise wrote:
>> hi all,
>> i have some problems with my java app and int8 pks. i browsed the 
>> mail-archives and found the
>> following mail thread *Re: "Fix" for INT8 literals being parsed as 
>> INT4 disqualifying*
>> the last statement was:
>> That patch will be applied soon. But it will *not* be in the 7.4 
>> stable branch. It will be fixed in head of tree. Since it will break 
>> existing code I didn't want to add it to 7.4 in the middle of beta, 
>> or now that 7.4 is RC1.
>> full text of the mail i'm referring to:
>> http://archives.postgresql.org/pgsql-jdbc/2003-11/msg00057.php
>> has this been already adressed in the HEAD for the jdbc-driver? 
>> because i loaded it from
>> gborg via cvs and the problem still persists.
>
> I don't believe the patch in question ever got applied.
>
> The 7.5 server doesn't suffer from the same "type mismatch prevents 
> use of an index" problem, I believe. Or you could add an explicit 
> ::int8 cast to your query.
>
> My v3 protocol changes should fix this against a 7.4 server, but 
> they're some distance away from making it into the official driver at 
> the moment.
>
> -O
>
> ---------------------------(end of 
> broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
>               http://archives.postgresql.org




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

* Re: int4/int8 problem with jdbc was Re: "Fix" for INT8 literals
  2004-06-02 10:21 int4/int8 problem with jdbc was Re: "Fix" for INT8 literals being parsed as INT4 disqualifying Jan Heise <jan@janheise.de>
  2004-06-02 11:16 ` Re: int4/int8 problem with jdbc was Re: "Fix" for INT8 literals Oliver Jowett <oliver@opencloud.com>
  2004-06-02 11:47   ` Re: int4/int8 problem with jdbc was Re: "Fix" for INT8 literals Jan Heise <jan@janheise.de>
@ 2004-06-02 13:27     ` Paul Thomas <paul@tmsl.demon.co.uk>
  2004-06-03 07:07       ` Re: int4/int8 problem with jdbc was Re: "Fix" for INT8 literals Jan Heise <jan@janheise.de>
  0 siblings, 1 reply; 5+ messages in thread

From: Paul Thomas @ 2004-06-02 13:27 UTC (permalink / raw)
  To: Jan Heise <jan@janheise.de>; +Cc: Oliver Jowett <oliver@opencloud.com>; pgsql-jdbc


On 02/06/2004 12:47 Jan Heise wrote:
> oliver, thanks for your reply.
> 
> the db in question is a 7.4 site in production. upgrading to another 
> version is not really what i'd like
> to do. the explicit cast is problematic too, i'm using hibernate as my 
> orm. unless i missed something
> in the docs, i can not add the cast to the config - but this is sth. for 
> the hibernate forums.
> 
> the problem is a special case where i have to load objects from the 
> table in question by the pk
> (details would be quite long, but i can not change the table-structure 
> at this time). table size is
> approx. 120 million rows and approx 2 million rows have a pk < INT4_MAX. 
> so i think my only
> option is dropping the foreign keys, making the pks and all references 
> bigger than INT4_MAX
> and recreate the fk.
> 
> jan

There's an unofficial patch:

http://archives.postgresql.org/pgsql-jdbc/2003-09/msg00143.php

which might solve your problems for now. IIRC, there's a server-side patch 
been submitted which will solve the int4/int8 issue and may be 7.5.

-- 
Paul Thomas
+------------------------------+---------------------------------------------+
| Thomas Micro Systems Limited | Software Solutions for 
Business             |
| Computer Consultants         | 
http://www.thomas-micro-systems-ltd.co.uk   |
+------------------------------+---------------------------------------------+



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

* Re: int4/int8 problem with jdbc was Re: "Fix" for INT8 literals
  2004-06-02 10:21 int4/int8 problem with jdbc was Re: "Fix" for INT8 literals being parsed as INT4 disqualifying Jan Heise <jan@janheise.de>
  2004-06-02 11:16 ` Re: int4/int8 problem with jdbc was Re: "Fix" for INT8 literals Oliver Jowett <oliver@opencloud.com>
  2004-06-02 11:47   ` Re: int4/int8 problem with jdbc was Re: "Fix" for INT8 literals Jan Heise <jan@janheise.de>
  2004-06-02 13:27     ` Re: int4/int8 problem with jdbc was Re: "Fix" for INT8 literals Paul Thomas <paul@tmsl.demon.co.uk>
@ 2004-06-03 07:07       ` Jan Heise <jan@janheise.de>
  0 siblings, 0 replies; 5+ messages in thread

From: Jan Heise @ 2004-06-03 07:07 UTC (permalink / raw)
  To: Paul Thomas <paul@tmsl.demon.co.uk>; +Cc: pgsql-jdbc; Oliver Jowett <oliver@opencloud.com>

Thanks for your help,

for this special case I patched the JDBC-driver to wrap setInt and  
setLong to use setString instead.

Jan

Am 02.06.2004 um 15:27 schrieb Paul Thomas:

>
> On 02/06/2004 12:47 Jan Heise wrote:
>> oliver, thanks for your reply.
>> the db in question is a 7.4 site in production. upgrading to another  
>> version is not really what i'd like
>> to do. the explicit cast is problematic too, i'm using hibernate as  
>> my orm. unless i missed something
>> in the docs, i can not add the cast to the config - but this is sth.  
>> for the hibernate forums.
>> the problem is a special case where i have to load objects from the  
>> table in question by the pk
>> (details would be quite long, but i can not change the  
>> table-structure at this time). table size is
>> approx. 120 million rows and approx 2 million rows have a pk <  
>> INT4_MAX. so i think my only
>> option is dropping the foreign keys, making the pks and all  
>> references bigger than INT4_MAX
>> and recreate the fk.
>> jan
>
> There's an unofficial patch:
>
> http://archives.postgresql.org/pgsql-jdbc/2003-09/msg00143.php
>
> which might solve your problems for now. IIRC, there's a server-side  
> patch been submitted which will solve the int4/int8 issue and may be  
> 7.5.
>
> --  
> Paul Thomas
> +------------------------------ 
> +---------------------------------------------+
> | Thomas Micro Systems Limited | Software Solutions for Business        
>       |
> | Computer Consultants         |  
> http://www.thomas-micro-systems-ltd.co.uk   |
> +------------------------------ 
> +---------------------------------------------+
>
> ---------------------------(end of  
> broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
>               http://www.postgresql.org/docs/faqs/FAQ.html




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


end of thread, other threads:[~2004-06-03 07:07 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-06-02 10:21 int4/int8 problem with jdbc was Re: "Fix" for INT8 literals being parsed as INT4 disqualifying Jan Heise <jan@janheise.de>
2004-06-02 11:16 ` Re: int4/int8 problem with jdbc was Re: "Fix" for INT8 literals Oliver Jowett <oliver@opencloud.com>
2004-06-02 11:47   ` Re: int4/int8 problem with jdbc was Re: "Fix" for INT8 literals Jan Heise <jan@janheise.de>
2004-06-02 13:27     ` Re: int4/int8 problem with jdbc was Re: "Fix" for INT8 literals Paul Thomas <paul@tmsl.demon.co.uk>
2004-06-03 07:07       ` Re: int4/int8 problem with jdbc was Re: "Fix" for INT8 literals Jan Heise <jan@janheise.de>

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