Re: auto increment

From: "Martin A(dot) Marques" <martin(at)math(dot)unl(dot)edu(dot)ar>
To: Marcos <marcos(at)second(dot)ival(dot)es>, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: auto increment
Date: 2000-11-09 12:55:26
Message-ID: 00110909552601.13385@math.unl.edu.ar
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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
-----------------------------------------------------------------
Martn Marqus email: martin(at)math(dot)unl(dot)edu(dot)ar
Santa Fe - Argentina http://math.unl.edu.ar/~martin/
Administrador de sistemas en math.unl.edu.ar
-----------------------------------------------------------------

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Peter Pilsl 2000-11-09 13:11:55 Re: TEXT and BLOBS
Previous Message Martin A. Marques 2000-11-09 12:00:13 Re: TEXT and BLOBS