db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Eade <se...@backstagetech.com.au>
Subject Re: Sequence bug in Postgres
Date Wed, 21 Apr 2004 23:30:04 GMT
Shevek wrote:

>File DBPostgres.java
>    /**
>     * @param name The name of the field (should be of type
>     *      <code>String</code>).
>     * @return SQL to retreive the next database key.
>     * @see org.apache.torque.adapter.DB#getIDMethodSQL(Object)
>     */
>    public String getIDMethodSQL(Object name)
>    {
>        return ("select currval('" + name + "')");
>    }
>This should clearly be nextval not currval. This unfortunately makes 
>PostgreSQL unusable with Torque until fixed. Oracle, SAP, etc do not have 
>this bug.
The id is retrieved after the insert so currval() is correct.  I think 
you will find that there are quite a few people that are successfully 
using Torque with PostgreSQL sequences.

>Please Cc me in any important replies. (Or perhaps just to let me know
>that someone has seen this?) Many more of these and I probably have to
>join the list anyway.
If you want to make posts and see replies then please do subscribe to 
the list.

>Oh, and postgres isn't capable of upgrading itself using the
>project-schema.sql script since it doesn't drop things in the right order.  
>No patch for this yet.
This has already been addressed in CVS by adding "cascade" to the drop 
table statements for PostgreSQL.

BTW: If you were The Borg then you would have assimilated this 
information already from the mailing list archive and the Torque wiki. :-)


Scott Eade
Backstage Technologies Pty. Ltd.

To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org

View raw message