Return-Path: Delivered-To: apmail-db-torque-dev-archive@www.apache.org Received: (qmail 56013 invoked from network); 16 Feb 2004 17:13:25 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 16 Feb 2004 17:13:25 -0000 Received: (qmail 94699 invoked by uid 500); 16 Feb 2004 17:13:19 -0000 Delivered-To: apmail-db-torque-dev-archive@db.apache.org Received: (qmail 94487 invoked by uid 500); 16 Feb 2004 17:13:18 -0000 Mailing-List: contact torque-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Apache Torque Developers List" Reply-To: "Apache Torque Developers List" Delivered-To: mailing list torque-dev@db.apache.org Received: (qmail 94473 invoked from network); 16 Feb 2004 17:13:17 -0000 Received: from unknown (HELO host.neuronfarm.com) (64.91.254.143) by daedalus.apache.org with SMTP; 16 Feb 2004 17:13:17 -0000 Received: from [66.84.238.30] (helo=10.100.15.58) by host.neuronfarm.com with asmtp (TLSv1:RC4-MD5:128) (Exim 4.24) id 1AslsA-0006YD-7M for torque-dev@db.apache.org; Mon, 16 Feb 2004 11:45:30 -0500 From: Sean Laurent Organization: Neuron Farm To: torque-dev@db.apache.org Subject: Problem w/PostgreSQL Insert Date: Mon, 16 Feb 2004 11:21:06 -0600 User-Agent: KMail/1.5.3 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200402161121.06446.sean@neuronfarm.com> X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - host.neuronfarm.com X-AntiAbuse: Original Domain - db.apache.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - neuronfarm.com X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N I already posted about this, but no one responded, so I'll try again. There is a bug in the PostgreSQL adapter code that Tim Regovich pointed out in December of 2002: http://nagoya.apache.org/eyebrowse/ReadMsg?listName=torque-dev@db.apache.org&msgId=590783 The basic idea is that getIDMethodSQL() uses the 'currval' function, which causes problems on inserts with an error messages like 'xxx.currval is not yet defined in this session.' According to the PostgreSQL documentation, currval() returns "the value most recently obtained by nextval for this sequence in the current session. (An error is reported if nextval has never been called for this sequence in this session.)" Notice the part in parenthesis. For new sessions, nextval() will never have been called and thus currval() won't work. The proper solution is simply to use nextval() instead of currval(). I was easily able to change this in my copy of the Torque code and my testing indicates that it's now working properly. What can I do to help make certain this gets fixed in the main Torque development line? -Sean ------------------------------ Programming is an art form that fights back. ------------------------------ --------------------------------------------------------------------- To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org For additional commands, e-mail: torque-dev-help@db.apache.org