From jkanter@virginia.edu Wed Jun 18 13:47:47 2003 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 37B2230DC48 for ; Wed, 18 Jun 2003 13:47:47 +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 56198-10 for ; Wed, 18 Jun 2003 10:47:36 -0300 (ADT) Received: from mail.virginia.edu (mail.Virginia.EDU [128.143.2.9]) by svr1.postgresql.org (Postfix) with SMTP id 85BB930DC37 for ; Wed, 18 Jun 2003 10:47:36 -0300 (ADT) Received: from smtp.mail.virginia.edu by mail.virginia.edu id ac13635; 18 Jun 2003 9:47 EDT Received: from virginia.edu (d-128-19-222.bootp.Virginia.EDU [128.143.19.222]) by smtp.mail.Virginia.EDU (8.11.7/8.11.6) with ESMTP id h5IDlZl35940 for ; Wed, 18 Jun 2003 09:47:35 -0400 Message-ID: <3EF06F67.1010901@virginia.edu> Date: Wed, 18 Jun 2003 09:55:51 -0400 From: Jodi Kanter User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.4) Gecko/20011128 Netscape6/6.2.1 X-Accept-Language: en-us MIME-Version: 1.0 To: Postgres Admin List Subject: checking currval Content-Type: multipart/alternative; boundary="------------090800070902000209050708" X-Archive-Number: 200306/220 X-Sequence-Number: 9211 --------------090800070902000209050708 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit 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 -- _______________________________ Jodi L Kanter BioInformatics Database Administrator University of Virginia (434) 924-2846 jkanter@virginia.edu --------------090800070902000209050708 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit 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
--
________________________________

_______________________________
Jodi L Kanter
BioInformatics Database Administrator
University of Virginia
(434) 924-2846
jkanter@virginia.edu


 

 

 

--------------090800070902000209050708-- From laser@zhengmai.com.cn Wed Jun 18 14:01:37 2003 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 9EE7830DCDD for ; Wed, 18 Jun 2003 14:01:37 +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 59925-07 for ; Wed, 18 Jun 2003 11:01:27 -0300 (ADT) Received: from mail.zhengmai.com.cn (unknown [202.99.6.10]) by svr1.postgresql.org (Postfix) with ESMTP id 95A8A30DC17 for ; Wed, 18 Jun 2003 11:01:25 -0300 (ADT) Received: from zhengmai.com.cn ([61.48.124.226]) by mail.zhengmai.com.cn (8.9.3/8.9.3) with ESMTP id VAA01631; Wed, 18 Jun 2003 21:57:38 +0800 (BST) Message-ID: <3EF07087.8080409@zhengmai.com.cn> Date: Wed, 18 Jun 2003 22:00:39 +0800 From: Weiping He User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; zh-CN; rv:1.4) Gecko/20030529 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jodi Kanter Cc: Postgres Admin List Subject: Re: checking currval References: <3EF06F67.1010901@virginia.edu> In-Reply-To: <3EF06F67.1010901@virginia.edu> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Archive-Number: 200306/221 X-Sequence-Number: 9212 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 From jkanter@virginia.edu Wed Jun 18 14:18:03 2003 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 E96FD30D181 for ; Wed, 18 Jun 2003 14:18:03 +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 61660-10 for ; Wed, 18 Jun 2003 11:17:53 -0300 (ADT) Received: from mail.virginia.edu (mail.Virginia.EDU [128.143.2.9]) by svr1.postgresql.org (Postfix) with SMTP id E872E30DB9D for ; Wed, 18 Jun 2003 11:17:51 -0300 (ADT) Received: from smtp.mail.virginia.edu by mail.virginia.edu id aa05579; 18 Jun 2003 10:17 EDT Received: from virginia.edu (d-128-19-222.bootp.Virginia.EDU [128.143.19.222]) by smtp.mail.Virginia.EDU (8.11.7/8.11.6) with ESMTP id h5IEGLl33738; Wed, 18 Jun 2003 10:16:21 -0400 Message-ID: <3EF07624.7010904@virginia.edu> Date: Wed, 18 Jun 2003 10:24:36 -0400 From: Jodi Kanter User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.4) Gecko/20011128 Netscape6/6.2.1 X-Accept-Language: en-us MIME-Version: 1.0 To: Weiping He Cc: Postgres Admin List Subject: Re: checking currval References: <3EF06F67.1010901@virginia.edu> <3EF07087.8080409@zhengmai.com.cn> Content-Type: multipart/alternative; boundary="------------000802060201010608050001" X-Archive-Number: 200306/222 X-Sequence-Number: 9213 --------------000802060201010608050001 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit 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 -- _______________________________ Jodi L Kanter BioInformatics Database Administrator University of Virginia (434) 924-2846 jkanter@virginia.edu --------------000802060201010608050001 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit 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

--
________________________________

_______________________________
Jodi L Kanter
BioInformatics Database Administrator
University of Virginia
(434) 924-2846
jkanter@virginia.edu


 

 

 


--------------000802060201010608050001-- From bruno@wolff.to Wed Jun 18 14:31:32 2003 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 3EC2030DBD6 for ; Wed, 18 Jun 2003 14:31:32 +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 63118-04 for ; Wed, 18 Jun 2003 11:31:21 -0300 (ADT) Received: from wolff.to (wolff.to [66.93.249.74]) by svr1.postgresql.org (Postfix) with SMTP id 8DB3230DB9D for ; Wed, 18 Jun 2003 11:31:21 -0300 (ADT) Received: (qmail 20452 invoked by uid 500); 18 Jun 2003 14:34:23 -0000 Date: Wed, 18 Jun 2003 09:34:23 -0500 From: Bruno Wolff III To: Jodi Kanter Cc: Postgres Admin List Subject: Re: checking currval Message-ID: <20030618143423.GB20256@wolff.to> Mail-Followup-To: Jodi Kanter , Postgres Admin List References: <3EF06F67.1010901@virginia.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3EF06F67.1010901@virginia.edu> User-Agent: Mutt/1.5.4i X-Archive-Number: 200306/225 X-Sequence-Number: 9216 On Wed, Jun 18, 2003 at 09:55:51 -0400, 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? What value do you expect to see and why do you want to see it? From scott.marlowe@ihs.com Wed Jun 18 15:15:52 2003 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 > > >