A bug in 7.3 jdbc driver

Поиск
Список
Период
Сортировка
Искать

A bug in 7.3 jdbc driver

От:
Michael Andreasen <michael@dunlops.com>
Дата:
Going a getObject() on a money field with a value over 1,000 causes an 
error;

Bad Double 3,273.65
	at 
org.postgresql.jdbc1.AbstractJdbc1ResultSet.toDouble(AbstractJdbc1ResultSet.java:775)
	at 
org.postgresql.jdbc1.AbstractJdbc1ResultSet.getDouble(AbstractJdbc1ResultSet.java:159)
	at 
org.postgresql.jdbc2.AbstractJdbc2ResultSet.getObject(AbstractJdbc2ResultSet.java:116)

I guess it's the comma!


Re: A bug in 7.3 jdbc driver

От:
Kris Jurka <books@ejurka.com>
Дата:
Вложения:


On Fri, 31 Oct 2003, Michael Andreasen wrote:

> Going a getObject() on a money field with a value over 1,000 causes an
> error;
>
> Bad Double 3,273.65
> 	at
> org.postgresql.jdbc1.AbstractJdbc1ResultSet.toDouble(AbstractJdbc1ResultSet.java:775)
> 	at
> org.postgresql.jdbc1.AbstractJdbc1ResultSet.getDouble(AbstractJdbc1ResultSet.java:159)
> 	at
> org.postgresql.jdbc2.AbstractJdbc2ResultSet.getObject(AbstractJdbc2ResultSet.java:116)
>
> I guess it's the comma!

Here's a patch against cvs tip which fixes this bug.  Also I've added a
test to the regression suite to future proof this fix.

Kris Jurka

Re: A bug in 7.3 jdbc driver now support for PG money type

От:
Dave Cramer <pg@fastcrypt.com>
Дата:
Michael,

Would it be possible for you to use the getObject() method instead. In
order to support the money type as a double we need to put some code in
to check for the $, and comma's; Given that money is a deprecated type
in postgres this is alot of cycles in the driver to support a case which
will be used sparsely.


Dave

On Fri, 2003-10-31 at 16:55, Michael Andreasen wrote:
> Going a getObject() on a money field with a value over 1,000 causes an 
> error;
> 
> Bad Double 3,273.65
> 	at 
> org.postgresql.jdbc1.AbstractJdbc1ResultSet.toDouble(AbstractJdbc1ResultSet.java:775)
> 	at 
> org.postgresql.jdbc1.AbstractJdbc1ResultSet.getDouble(AbstractJdbc1ResultSet.java:159)
> 	at 
> org.postgresql.jdbc2.AbstractJdbc2ResultSet.getObject(AbstractJdbc2ResultSet.java:116)
> 
> I guess it's the comma!
> 
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 8: explain analyze is your friend
> 
> 

Re: A bug in 7.3 jdbc driver now support for PG money type

От:
Kris Jurka <books@ejurka.com>
Дата:


On 3 Nov 2003, Dave Cramer wrote:

> Michael,
>
> Would it be possible for you to use the getObject() method instead. In
> order to support the money type as a double we need to put some code in
> to check for the $, and comma's; Given that money is a deprecated type
> in postgres this is alot of cycles in the driver to support a case which
> will be used sparsely.

The patch I suggested is not sufficient as it does not handle other
locales.  Currently anything that uses a different currency symbol or
grouping separator is broken.  I would suggest that we remove all support
for money other than getString() because we can't attempt to parse it
without correctly knowing the locale.

Kris Jurka


FAQ