Re: [GENERAL] The value returned by autoinc ?

From: Silvio Emanuel Barbosa de Macedo <smacedo(at)inescn(dot)pt>
To: Herouth Maoz <herouth(at)oumail(dot)openu(dot)ac(dot)il>
Cc: pgsql general mailing list <pgsql-general(at)postgresql(dot)org>
Subject: Re: [GENERAL] The value returned by autoinc ?
Date: 1999-03-15 09:59:28
Message-ID: Pine.GSO.3.96.990315095347.20927D-100000@newton.inescn.pt
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)inescn(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Clark Evans 1999-03-15 10:10:53 Re: [GENERAL] The value returned by autoinc ?
Previous Message Herouth Maoz 1999-03-15 09:51:39 Re: [GENERAL] The value returned by autoinc ?