Re: Serial / Secuencia

From: Espartano <espartano(dot)mail(at)gmail(dot)com>
To: "Alvaro Herrera" <alvherre(at)commandprompt(dot)com>
Cc: "MIGUEL CANCHAS" <mcanchas(at)tsr(dot)com(dot)pe>, pgsql-es-ayuda(at)postgresql(dot)org
Subject: Re: Serial / Secuencia
Date: 2007-10-23 16:10:33
Message-ID: d353bd50710230910l3b925d31q1a5cc94572d853fe@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

El 23/10/07, Alvaro Herrera <alvherre(at)commandprompt(dot)com> escribió:
> MIGUEL CANCHAS escribió:
> > Amigos hace un tiempo atras consulte sobre contadores en las tablas para
> > poder realizar codigos unicos(Primary Key) y enlazarlos en Cabecera -
> > Detalle, bien empece a usar campos SERIAL, cuando grabo genera
> > automaticamente el codigo o correlativo, hasta alli todo bien, lo que
> > necesito es como devolver el codigo que generó cuando se realizó la
> > grabación.
>
> SELECT currval('serial');
> (o era "curval"?)

currval me parece, curval creo que es una funcion trigonometrica.

>
> --
> Alvaro Herrera http://www.PlanetPostgreSQL.org/
> "The eagle never lost so much time, as
> when he submitted to learn of the crow." (William Blake)
> --
> TIP 8: explain analyze es tu amigo
>

--
"Linux is for people who hate Windows, BSD is for people who love UNIX".
"Social Engineer -> Because there is no patch for human stupidity"
"The Unix Guru's View of Sex unzip ; strip ; touch ; grep ; finger ;
mount ; fsck ; more ; yes ; umount ; sleep."
"Documentation is like sex: when it is good, it is very, very good;
and when it is bad, it is better than nothing."

In response to

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Agustin Casiva 2007-10-23 16:52:09 Re: Conexion a servidor Postgresql 8.1 y 8.2
Previous Message Alvaro Herrera 2007-10-23 16:04:57 Re: Serial / Secuencia