Re: "SEQUENCE" e "IDENTITY" en PostgreSql

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Eusebio Estrada Alvarez <eestradaa(at)hotmail(dot)com>
Cc: Sizu <pixradio(at)gmail(dot)com>, Nebur Álvarez Bermúdez <neburx86(at)gmail(dot)com>, pgsql-es-ayuda(at)postgresql(dot)org
Subject: Re: "SEQUENCE" e "IDENTITY" en PostgreSql
Date: 2007-06-27 19:50:25
Message-ID: 20070627195025.GF11996@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

Eusebio Estrada Alvarez escribió:
>
> Hola amigos, En Sql server existe el dato de tipo IDENTITY el cual lo incrementa automaticamente la bd(lo tengo entendido asi).Esto mismo se puede hacer en Oracle, aunque necesita de Un objeto SEQUENCE y un TRIGGER. Les pregunto: - Saben como hacerlo en POSTGRESQL ??

Usa una columna de tipo serial, que internamente es un alias para una
columna tipo integer con DEFAULT nextval(una secuencia que se crea para esto).

--
Alvaro Herrera http://www.amazon.com/gp/registry/DXLWNGRJD34J
"Before you were born your parents weren't as boring as they are now. They
got that way paying your bills, cleaning up your room and listening to you
tell them how idealistic you are." -- Charles J. Sykes' advice to teenagers

In response to

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Carlos Chávez Z. 2007-06-27 20:15:58 Consulta sobre trigger y nombre del PC
Previous Message Eusebio Estrada Alvarez 2007-06-27 19:47:08 "SEQUENCE" e "IDENTITY" en PostgreSql