On Jul 7, 2005, at 4:14 PM, Theodore Petrosky wrote:
>
> you have to use currval inside a transaction...
>
> begin;
> insert something that increments the counter;
> select currval('sequence_name');
> end;
>
> using currval inside a transaction guarantees that the
> value is correct for your insert statement and has not
> changed by another insert statement.
>
your understanding of currval() is completely incorrect. no
transaction is required.