public inbox for [email protected]  
help / color / mirror / Atom feed
[Pljava-dev] Possible bug, when updating BigDecimal from trigger/function
2+ messages / 0 participants
[nested] [flat]

* [Pljava-dev] Possible bug, when updating BigDecimal from trigger/function
@ 2008-06-08 20:06 
  2008-06-10 03:47 ` [Pljava-dev] Possible bug, when updating BigDecimal from trigger/function 
  0 siblings, 1 reply; 2+ messages in thread

From:  @ 2008-06-08 20:06 UTC (permalink / raw)

Hello,

When PL/Java trigger/function is updating BigDecimal, scale of new 
BigDecimal value is not checked. Because of this, is possible store in 
database numeric value with greater precision than is in column definition.

In result of this behavior sql dump can contains values with greater 
precision and subsequent import fails on affected tables.

Please can anybody confirm this behavior and is possible to fix this.

Best regards.

Petr Michalek




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

* [Pljava-dev] Possible bug, when updating BigDecimal from trigger/function
  2008-06-08 20:06 [Pljava-dev] Possible bug, when updating BigDecimal from trigger/function 
@ 2008-06-10 03:47 ` 
  0 siblings, 0 replies; 2+ messages in thread

From:  @ 2008-06-10 03:47 UTC (permalink / raw)

Petr Mich?lek wrote:
> 
> When PL/Java trigger/function is updating BigDecimal, scale of new 
> BigDecimal value is not checked. Because of this, is possible store in 
> database numeric value with greater precision than is in column definition.
> 
> Please can anybody confirm this behavior and is possible to fix this.
> 

I haven't tested it myself, but it certainly looks like something that 
would happen when updating TriggerData.  Under the hood we're using 
SPI_modifytuple which is apparently too low level for pg to do the 
precision/scale checks and it expects us to perform them before calling 
this method.  For pljava, the conversion to backend type is going 
through a generic type conversion routine which doesn't have access to 
typmod information.  It seems like we'd have to modify the whole 
coerceObject interface to support passing around typmod.  I'm not sure 
how hard that would be to do.

Kris Jurka





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


end of thread, other threads:[~2008-06-10 03:47 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2008-06-08 20:06 [Pljava-dev] Possible bug, when updating BigDecimal from trigger/function 
2008-06-10 03:47 ` 

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox