temp sequence - Mailing list pgsql-general

From Sim Zacks
Subject temp sequence
Date
Msg-id 4BE11FFA.5060602@compulab.co.il
Whole thread Raw
Responses Re: temp sequence  (Scott Marlowe <scott.marlowe@gmail.com>)
Re: temp sequence  ("Greg Sabino Mullane" <greg@turnstep.com>)
Re: temp sequence  (Andy Colson <andy@squeakycode.net>)
List pgsql-general
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?

Sim

pgsql-general by date:

Previous
From: Vincenzo Romano
Date:
Subject: Re: (psuedo) random serial for PK or at least UNIQUE NOT NULL?
Next
From: "williamkidd@libero.it"
Date:
Subject: database Benchmark, TPC, PostgreSQL and TPC-E