Hello,
Please ignore if this is a redundant find, but I searched the archives
and found nothing apropos.
The Postgres db adapter seems to have an inconsitency in it.
The getSequenceSql(...) method has been deprecated in favor of the
getIDMethodSQL(...) method, yet the methods are not functionally
equivalent. getSequenceSql() (correctly) uses the 'nextval' function,
while getIDMethodSQL () uses the 'currval' function. Thisd causes
problems on insert with an error messages like 'xxx.currval is not yet
defined in this session.'
If I change 'currval' to 'nextval', then all seems to work well.
I have attached my patch :
Index: src/java/org/apache/torque/adapter/DBPostgres.java
===================================================================
RCS file:
/home/cvspublic/jakarta-turbine-torque/src/java/org/apache/torque/adapter/DBPostgres.java,v
retrieving revision 1.14
diff -w -r1.14 DBPostgres.java
66c66
< * @version $Id: DBPostgres.java,v 1.14 2002/12/12 11:28:14 mpoeschl
Exp $
---
> * @version $Id: DBPostgres.java,v 1.13 2002/09/19 07:54:37 jon Exp $
117c117,129
< return ("select currval('" + name + "')");
---
> return ("select nextval('" + name + "')");
> }
>
Regards,
Tim Regovich
[EMAIL PROTECTED]
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>