Changes to sequence.c

bill.allie@mug.org

From: "Billy G. Allie" <Bill.Allie@mug.org>
To: pgsql-patches@postgreSQL.org
Cc: pgsql-hackers@postgreSQL.org
Date: 1998-03-02T06:16:24Z
Lists: pgsql-hackers

Attachments

I encountered a problem (bug? feature?) where "select currval('sequence')" 
will generate an error if "select nextval('sequence')" is not executed first.  
The attached patch will change this behaviour by reading the sequence tuple 
and returning the last_value attribute if nextval has not been called on the 
sequence yet.

The patched code appears to work as intended and did not have any effect on 
the output of the regression test.