Re: temp sequence - Mailing list pgsql-general

From Scott Marlowe
Subject Re: temp sequence
Date
Msg-id t2wdcc563d11005050552t361587cem1ae1b751ab26b86a@mail.gmail.com
Whole thread Raw
In response to temp sequence  (Sim Zacks <sim@compulab.co.il>)
List pgsql-general
2010/5/5 Sim Zacks <sim@compulab.co.il>:
> I am using 8.2.14
>
> I am trying to use a temp sequence in a function and I'm having a lot of
> trouble.
> I create the temp sequence and then I have to drop it at the end of the
> function, because it stays alive for the whole session and not just the
> function.
> I want to use the nextval function in an update statement so it gives a
> sequence number to each row it updates.
> If I drop the sequence and recreate it I get an OID not found error.
> I tried to run the update statement dynamically, but part of the update
> stmt is an int array variable and it won't cast it to text.
>
> My goal in the end is that every row that is updated will be numbered
> sequentially per update.
>
> Do you have any ideas?

Can you manipulate the sequence instead of dropping it?  i.e. select
setval('seqname',1); kind of thing?

pgsql-general by date:

Previous
From: Scott Marlowe
Date:
Subject: Re: alter table alter type CASCADE
Next
From: "Greg Sabino Mullane"
Date:
Subject: Re: temp sequence