Re: problema con campo serial

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Jaime Casanova <systemguards(at)gmail(dot)com>
Cc: jose fermin francisco ferreras <josefermin54(at)hotmail(dot)com>, pgsql-es-ayuda(at)postgresql(dot)org
Subject: Re: problema con campo serial
Date: 2005-09-06 13:28:17
Message-ID: 20050906132817.GB25073@surnet.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

On Mon, Sep 05, 2005 at 04:05:53PM -0500, Jaime Casanova wrote:

> Bueno, si se puede pero no usando serial tendrias que asignar
> manualmente el siguiente codigo haciendo un: select codigo from tabla
> order by codigo desc limit 1

Eso no funciona si tienes dos procesos insertando simultaneamente ...
ambos pueden querer insertar el mismo numero.

--
Alvaro Herrera -- Valdivia, Chile Architect, www.EnterpriseDB.com
"The important things in the world are problems with society that we don't
understand at all. The machines will become more complicated but they won't
be more complicated than the societies that run them." (Freeman Dyson)

In response to

Responses

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Jota Machuca 2005-09-06 15:20:25 Re: problema con campo serial
Previous Message Mario Gonzalez 2005-09-06 04:48:32 Re: Administracion de Usuarios