Re: auto increment - Mailing list pgsql-general

From Martin A. Marques
Subject Re: auto increment
Date
Msg-id 00110909552601.13385@math.unl.edu.ar
Whole thread Raw
In response to auto increment  (Marcos <marcos@second.ival.es>)
List pgsql-general
On Jue 09 Nov 2000 07:56, Marcos wrote:
> hi,
>
>     i am creating a table and i want to add an auto incrementable field
>
>     is that correct?
>
> psql ival << EOF
> create table partes (
> codigo int not null auto_increment,

WRONG. That is not ANSI-SQL. That is MySQL.
Define it as SERIAL, just like all the good database servers do.

> usuario varchar(15),
> fecha date,
> proyecto varchar(30),
> horas int4,
> trabajo varchar(100),
> observaciones varchar(90),
> primary key(codigo));
> EOF

Try to read the user manual for information on querys.

Saludos... :-)


--
"And I'm happy, because you make me feel good, about me." - Melvin Udall
-----------------------------------------------------------------
Mart�n Marqu�s            email:     martin@math.unl.edu.ar
Santa Fe - Argentina        http://math.unl.edu.ar/~martin/
Administrador de sistemas en math.unl.edu.ar
-----------------------------------------------------------------

pgsql-general by date:

Previous
From: "Oliver Elphick"
Date:
Subject: Re: auto increment
Next
From: Peter Pilsl
Date:
Subject: Re: TEXT and BLOBS