Re: [GENERAL] The value returned by autoinc ? - Mailing list pgsql-general

From Silvio Emanuel Barbosa de Macedo
Subject Re: [GENERAL] The value returned by autoinc ?
Date
Msg-id Pine.GSO.3.96.990315095347.20927D-100000@newton.inescn.pt
Whole thread Raw
In response to Re: [GENERAL] The value returned by autoinc ?  (Herouth Maoz <herouth@oumail.openu.ac.il>)
Responses Re: [GENERAL] The value returned by autoinc ?
List pgsql-general
    Thank you for your answer.
    Still, one doubt.

On Mon, 15 Mar 1999, Herouth Maoz wrote:
>   INSERT...
>   SELECT currval( 'seq_name' );
>...
> It will also give you the
>correct number even if between the INSERT and the SELECT, another process
>or another connection also made an insert.
>Herouth

If there is an insert between my INSERT and SELECT, won't the counter be
increased ? The only way I can understand this is the transaction locks
inserts... so, in fact there could not exist another insert...

Am I wrong (or better, how wrong am I :) ) ?

Thanks again!


,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
`````````````````````````````````````````````
Silvio Emanuel Nunes Barbosa de Macedo
mailto:smacedo@inescn.pt

INESC - Porto - Grupo CAV
Pc da Republica, 93 R/C   Tel:351 2 209 42 21
4000 PORTO  PORTUGAL      Fax:351 2 208 41 72








pgsql-general by date:

Previous
From: Herouth Maoz
Date:
Subject: Re: [GENERAL] The value returned by autoinc ?
Next
From: Clark Evans
Date:
Subject: Re: [GENERAL] The value returned by autoinc ?