pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
checking currval
5+ messages / 4 participants
[nested] [flat]

* checking currval
@ 2003-06-18 13:55 Jodi Kanter <jkanter@virginia.edu>
  2003-06-18 14:00 ` Re: checking currval Weiping He <laser@zhengmai.com.cn>
  2003-06-18 14:34 ` Re: checking currval Bruno Wolff III <bruno@wolff.to>
  0 siblings, 2 replies; 5+ messages in thread

From: Jodi Kanter @ 2003-06-18 13:55 UTC (permalink / raw)
  To: pgsql-admin

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 <mailto:jkanter@virginia.edu>

 

 

 

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: checking currval
  2003-06-18 13:55 checking currval Jodi Kanter <jkanter@virginia.edu>
@ 2003-06-18 14:00 ` Weiping He <laser@zhengmai.com.cn>
  2003-06-18 14:24   ` Re: checking currval Jodi Kanter <jkanter@virginia.edu>
  1 sibling, 1 reply; 5+ messages in thread

From: Weiping He @ 2003-06-18 14:00 UTC (permalink / raw)
  To: Jodi Kanter <jkanter@virginia.edu>; +Cc: pgsql-admin

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






^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: checking currval
  2003-06-18 13:55 checking currval Jodi Kanter <jkanter@virginia.edu>
  2003-06-18 14:00 ` Re: checking currval Weiping He <laser@zhengmai.com.cn>
@ 2003-06-18 14:24   ` Jodi Kanter <jkanter@virginia.edu>
  2003-06-18 15:13     ` Re: checking currval scott.marlowe <scott.marlowe@ihs.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Jodi Kanter @ 2003-06-18 14:24 UTC (permalink / raw)
  To: Weiping He <laser@zhengmai.com.cn>; +Cc: pgsql-admin

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 <mailto:jkanter@virginia.edu>

 

 

 

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: checking currval
  2003-06-18 13:55 checking currval Jodi Kanter <jkanter@virginia.edu>
  2003-06-18 14:00 ` Re: checking currval Weiping He <laser@zhengmai.com.cn>
  2003-06-18 14:24   ` Re: checking currval Jodi Kanter <jkanter@virginia.edu>
@ 2003-06-18 15:13     ` scott.marlowe <scott.marlowe@ihs.com>
  0 siblings, 0 replies; 5+ messages in thread

From: scott.marlowe @ 2003-06-18 15:13 UTC (permalink / raw)
  To: Jodi Kanter <jkanter@virginia.edu>; +Cc: Weiping He <laser@zhengmai.com.cn>; pgsql-admin

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
> 
> 
> 




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: checking currval
  2003-06-18 13:55 checking currval Jodi Kanter <jkanter@virginia.edu>
@ 2003-06-18 14:34 ` Bruno Wolff III <bruno@wolff.to>
  1 sibling, 0 replies; 5+ messages in thread

From: Bruno Wolff III @ 2003-06-18 14:34 UTC (permalink / raw)
  To: Jodi Kanter <jkanter@virginia.edu>; +Cc: pgsql-admin

On Wed, Jun 18, 2003 at 09:55:51 -0400,
  Jodi Kanter <jkanter@virginia.edu> 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?



^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2003-06-18 15:13 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-06-18 13:55 checking currval Jodi Kanter <jkanter@virginia.edu>
2003-06-18 14:00 ` Weiping He <laser@zhengmai.com.cn>
2003-06-18 14:24   ` Jodi Kanter <jkanter@virginia.edu>
2003-06-18 15:13     ` scott.marlowe <scott.marlowe@ihs.com>
2003-06-18 14:34 ` Bruno Wolff III <bruno@wolff.to>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox