Received: from mx99.openu.ac.il (arbel.openu.ac.il [147.233.32.4]) by hub.org (8.9.3/8.9.3) with ESMTP id KAA35687 for ; Tue, 27 Jul 1999 10:35:32 -0400 (EDT) (envelope-from herouth@oumail.openu.ac.il) Received: from talmon.openu.ac.il (talmon.openu.ac.il [147.233.32.11]) by mx99.openu.ac.il (Postfix) with ESMTP for id A97D94B5BB; Tue, 27 Jul 1999 17:35:31 +0300 (IDT) Received: from [147.233.159.109] (mac-herouth.pc.openu.ac.il) by talmon.openu.ac.il (Netscape Messaging Server 3.54) with ESMTP id AAA297A; Tue, 27 Jul 1999 17:38:49 +0300 X-Sender: herouth@shaked.cc.openu.ac.il Message-Id: In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Tue, 27 Jul 1999 17:36:09 +0300 To: marc rassbach , pgsql-sql@postgreSQL.org From: Herouth Maoz Subject: Re: [INTERFACES] How can I work thru this key problem? At 20:50 +0300 on 26/07/1999, marc rassbach wrote: > > When I place, oh say the string "Whatsmyid" into exampletable, I'd like to > be able to know the value of keyiwant is, without going back and doing a > select keyiwant from exampletable where otherinfo = "Whatsmyid" > > Ideas on how I can get to where I want to go? Yes, after the INSERT, do: SELECT currval('thenextkey'); This gives you the latest value of the sequence which your current session has produced. Yes, it is multiuser-safe - no other process will receive the number you produced except you. BTW, this shouldn't be in the interfaces list. It's an SQL question. Herouth -- Herouth Maoz, Internet developer. Open University of Israel - Telem project http://telem.openu.ac.il/~herutma