Oh, there's another solution I forgot to mention: you could write the
nextval call as
nextval('s'::text)
which would force a runtime lookup of 's' on each call. On the whole
though, numbering the rows yourself with a local counter is going to
run a lot faster.
Robins Tharakan [EMAIL PROTECTED] writes:
BEGIN
CREATE TEMPORARY SEQUENCE s INCREMENT BY 1 START WITH 1;
FOR rec in
SELECT nextval('s') as rank, tt.scheme_code, tt.ret
...
DROP SEQUENCE s;
END;
Sorry, that's not going to work, for fundamentally the same reason that
The following bug has been logged online:
Bug reference: 3662
Logged by: Robins Tharakan
Email address: [EMAIL PROTECTED]
PostgreSQL version: 8.2.5
Operating system: Windows XP Professional SP2
Description:Seems that more than one run of a functions causes an
error