Re: Autoincremental value

From: "gnari" <gnari(at)simnet(dot)is>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Autoincremental value
Date: 2004-08-13 21:31:04
Message-ID: 001301c4817c$d65b6c20$0100000a@wp2000
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Josué Maldonado" <josue(at)lamundial(dot)hn> wrote:
>
> El 13/08/2004 10:50 AM, adburne(at)asocmedrosario(dot)com(dot)ar en su mensaje
> escribio:
> > ...
> > insert into table1 (field1) values (1);
> > insert into table1 (field1) values (1);
> > insert into table1 (field1) values (2);
> >
> > and then select * from table1, you get:
> > field1| field2
> > ------+-------
> > 1 | 1
> > 1 | 2
> > 2 | 1
> > ------+-------
> >
> > there is a way to do this with postgres???
>
> Check the serial data type.

I do not think this is possible with the serial
data type in postgres.
notice how the field2 is reset to 1 for each new
value of field1

I did not know that this was possible in mysql.
you would think that this is tricky to implement.

gnari

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Gaetano Mendola 2004-08-13 22:54:08 Re: Postgres 8.0 -> BEGIN EXCEPTION END Syntax????
Previous Message Steve Crawford 2004-08-13 21:27:10 Re: psql wishlist: value completion