X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id 15FD230DC1E for ; Wed, 18 Jun 2003 15:15:52 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr1.postgresql.org [64.117.224.193]) (amavisd-new, port 10024) with ESMTP id 67263-03 for ; Wed, 18 Jun 2003 12:15:41 -0300 (ADT) Received: from mail1.ihs.com (mail1.ihs.com [170.207.70.222]) by svr1.postgresql.org (Postfix) with ESMTP id 2748630DC29 for ; Wed, 18 Jun 2003 12:15:41 -0300 (ADT) Received: from css120.ihs.com (css120.ihs.com [170.207.105.120]) by mail1.ihs.com (8.12.9/8.12.9) with ESMTP id h5IFEc4w003704; Wed, 18 Jun 2003 09:14:38 -0600 (MDT) Date: Wed, 18 Jun 2003 09:13:13 -0600 (MDT) From: "scott.marlowe" To: Jodi Kanter Cc: Weiping He , Postgres Admin List Subject: Re: checking currval In-Reply-To: <3EF07624.7010904@virginia.edu> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-MailScanner: Found to be clean X-MailScanner-SpamCheck: X-Archive-Number: 200306/226 X-Sequence-Number: 9217 What flavor Postgresql are you running? That works on both my 7.2.x boxes and my 7.3 boxes. If you're running anything older than 7.2.x, you might wanna upgrade before asking for help, since folks tend to assume you're running at least 7.2 around here. Note that this IS NOT TRANSACTION safe. If two processes do this at the same time and operate on that number, you can have a race condition that will cause you problems. Use the nextval,setval,currval functions for transaction safe sequence work. On Wed, 18 Jun 2003, Jodi Kanter wrote: > I tried that and it did not work. It won't be a problem in the code > since it appears that we are always doing a nextval prior to currval, > but I was just wondering about how to do it while in a psql session. > > Weiping He wrote: > > > select last_value from your_sequence; > > > > Jodi Kanter wrote: > > > >> I cannot view the currval because it is not set in the session yet. > >> Is there a way to set it without having to increment the value? > >> Thanks > >> Jodi > > > > > > > > > > > > ---------------------------(end of broadcast)--------------------------- > > TIP 7: don't forget to increase your free space map settings > > >