X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id BB58A52953 for ; Mon, 2 May 2005 13:30:18 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 26900-04 for ; Mon, 2 May 2005 16:30:14 +0000 (GMT) Received: from out2.smtp.messagingengine.com (out2.smtp.messagingengine.com [66.111.4.26]) by svr1.postgresql.org (Postfix) with ESMTP id ACB4B53813 for ; Mon, 2 May 2005 13:30:13 -0300 (ADT) Received: from web1.messagingengine.com (web1.internal [10.202.2.210]) by frontend1.messagingengine.com (Postfix) with ESMTP id 03AB5C88445 for ; Mon, 2 May 2005 12:30:12 -0400 (EDT) Received: by web1.messagingengine.com (Postfix, from userid 99) id 95B68FE3; Mon, 2 May 2005 12:30:12 -0400 (EDT) Message-Id: <1115051412.14477.233176976@webmail.messagingengine.com> X-Sasl-Enc: iu+StZtXmF5byxXELnadU3NKeyiKOaSCIeIZQCuoXYRH 1115051412 From: "Sam Adams" To: pgsql-sql@postgresql.org Content-Disposition: inline Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="iso-8859-1" MIME-Version: 1.0 X-Mailer: MIME::Lite 1.5 (F2.73; T1.001; A1.64; B3.05; Q3.03) Subject: Java and Currval Date: Mon, 02 May 2005 17:30:12 +0100 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.05 tagged_above=0 required=5 tests=FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200505/16 X-Sequence-Number: 21329 I'm having trouble getting the currval function to work from a Java program (or from Postgres at all). I want to get the value of addressid in the table taddress. The best I seem to be able to come up with is 'SELECT currval(taddress.addressid)'. However this gives me the error 'ERROR: relation "1" does not exist' or whatever the number should be. I've tried lots of variations but can't seem to work it out. What am I doing wrong? Thanks. -Sam