db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shevek <she...@anarres.org>
Subject Re: [DB Torque Wiki] Updated: PostgreSQLFAQ
Date Thu, 22 Apr 2004 01:12:11 GMT
On Thu, 22 Apr 2004 torque-dev@db.apache.org wrote:

> +== When I examine the source code I see that the PostgreSQL currval()
> function is used for idMethod='native' - this cannot possibly be right
> since it should quite obviously be using nextval(). == + +Please read
> the following thread in its entirety: + *
> http://nagoya.apache.org/eyebrowse/ReadMsg?listName=torque-dev@db.apache.org&msgNo=3537
> +The source also gives the impression that it is somehow using
> AUTOINCREMENT when SEQUENCE would seem to be the more obvious choice.  
> This is more of an indication of whether or not the id should be
> returned before or after the insert - the names of these things could
> certainly be improved. +
>  == Do I need to patch the PostgreSQL driver to work with Torque? ==

Thankyou. I see that this problem has been encountered before. 

So now if I don't set the id-method-parameter seqName, then postgres fails
because it's trying to select currval from a sequence which noone has
selected nextval from.

And if I do set the id-method-parameter seqName, then postgres fails
because it tries to create tables with a primary key sequence that Torque
already created.

It looks rather like Hobson's choice, and it's documented as such at 

Are you, by any chance, using a really old [and obsolete] version of

I won't say "You were right" because out of the box, it doesn't work, and
can't be made to work without hacking the generated code. However, I will
happily admit that it wasn't the bug I first thought it was.


Shevek                                    http://www.anarres.org/
I am the Borg.                         http://www.gothnicity.org/

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

View raw message