Re: Correct getScale() behavior?

From: Kris Jurka <books(at)ejurka(dot)com>
To: Dave Dombrosky <dombrd(at)gmail(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Correct getScale() behavior?
Date: 2008-05-08 06:33:24
Message-ID: Pine.BSO.4.64.0805080230540.16724@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Mon, 5 May 2008, Dave Dombrosky wrote:

> I have looked into the driver source, and it seems like a change was
> made in the 8.2+ drivers. When getting the result of an aggregate sum
> (of NUMERIC(7,2) values) in 8.1 it returns -1 as the scale, but in 8.2
> it returns 0. It looks like "-1" is meant to be taken as an undefined
> value, which seems to be the correct behavior to me.

This change was made because some ORM tools (some of the rowset stuff I
think) pulled the scale and stored it off regardless of whether it was
used or not. The storing code did "validation" that required it be >= 0.
So everyone using these frameworks was screwed whether they needed the
scale or not. So we changed it to keep them happy at the expense of
people like used based on a size of the camps measurement alone.

Kris Jurka

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Roy Smith 2008-05-09 03:54:54 Couple of preparedstatement bug suspects
Previous Message Kris Jurka 2008-05-08 06:30:44 Re: JDBC and GSSAPI/Krb5 with uDig