There is a bug with 7.2.x numeric... In theory, the latest version has it fixed (7.2.3) but I still had problems with it... 7.3 (cvs) has the 'real fix'
> -- Thus, Bruce Snyder had said: > This one time, at band camp, Boris Klug said: > > BK>Hello! > BK> > BK>we have several object with doubles that map to numeric(13,3) in our > BK>PostgreSQL DB (version 7.2). When Castor (version 0.9.4.1) tries to > write BK>back the object after a commit(), I get the following error: > BK> > BK>2002.11.29 11:30:14: WUI,INFO: [Castor]: > BK>org.exolab.castor.jdo.TransactionAbortedException: Nested error: > BK>org.exolab.castor.jdo.PersistenceException: > BK> Nested error: java.sql.SQLException: ERROR: Unable to identify an > operator BK>'=' for types 'numeric' and 'double precision' > BK>2002.11.29 11:30:14: WUI,INFO+ You will have to retype this query > using an BK>explicit cast > BK> > BK>This happends with the following JDBC driver versions for PostgreSQL: > 7.2, BK>7.3rc1, postgresdriver with is bundled with Castor. > BK>It does not occure with driver version 7.3beta1 which is now the only > working BK>driver available. > BK> > BK>You also produce the msg when you to this in psql: > BK>>create table t (x numeric(13,3)); > BK>>insert into t values(89.3); > BK>>select * from t where x=89.3; > BK>ERROR: Unable to identify an operator '=' for types 'numeric' and > 'double BK>precision' > BK> You will have to retype this query using an explicit cast BK> > BK>If you change the where clause to "where x='89.3' it works. This > seems to be BK>the right thing because also "where x='0089.30' gives > back the row. BK> > BK>Now PostgreSQL 7.3 is out and we want to use the final driver, no > longer the BK>beta one. So the question is now: Is this a problem inside > the jdbc driver of BK>PostgreSQL or inside Castor? Is there a > workaround? > BK> > BK>See also the posting > http://castor.exolab.org/list-archive/msg18062.html which BK>is related > to my problem. > BK> > > Boris, > > I know that casting can be done in Castor. Here is an example taken from > src/tests/jdo/TypeHandling.java, line #115: > > _oql = _db.getOQLQuery( "SELECT types FROM jdo.TestTypes types > WHERE id = $(integer)1" ); > > Notice the cast on the parameter passed to the OQL query. The id > that's bound to this particular query is of type int. > > But my knowledge of the PostgreSQL JDBC drivers is fairly elementary. > Ned Wolpert is our resident PostgreSQL expert. I'd like him to chime in > on this one with his knowledge. > > Bruce > -- > > perl -e 'print > unpack("u30","<0G)U8V4\@4VYY9&5R\"F9E<G)E=\$\!F<FEI+F-O;0\`\`");' Virtually, Ned Wolpert <[EMAIL PROTECTED]> "An idea is something you have; an ideology is something that has you." --Morris Berman ----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-dev
