Thread: create table autoincrement

create table autoincrement

From
Jose Manuel Lorenzo Lopez
Date:
Hello PG's,

is it possible to create a table with key fields (integer) that will autoincrement
when inserting a dataset???

Thanks for your help in advance!

Best Regards / Un saludo / Mit freundlichen Grüßen

José Manuel Lorenzo López

**********************************************************************
** José Manuel Lorenzo López                                        **
**                                                                  **
** ICA Informationssysteme Consulting & Anwendungsgesellschaft mbH  **
** Dept. SAP Basis R/3  VBue                                        **
**                                                                  **
** e-mail to: jose-manuel.lorenzo-lopez@ica.conti.de                **
**********************************************************************



Re: create table autoincrement

From
"Brent R. Matzelle"
Date:
--- Jose Manuel Lorenzo Lopez
<jose-manuel.lorenzo-lopez@ica.conti.de> wrote:
> Hello PG's,
>
> is it possible to create a table with key fields (integer)
> that will autoincrement
> when inserting a dataset???
>
> Thanks for your help in advance!

Try the SERIAL data type.

Brent

__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

Re: create table autoincrement

From
"Richard Huxton"
Date:
From: "Jose Manuel Lorenzo Lopez" <jose-manuel.lorenzo-lopez@ica.conti.de>

> Hello PG's,
>
> is it possible to create a table with key fields (integer) that will
autoincrement
> when inserting a dataset???
>
Look in the manuals for the CREATE SEQUENCE stuff. There is a special type
SERIAL which does all this for you. Check Bruce's online book too - bound to
have examples in that.

- Richard Huxton