Re: Autoincremental value - Mailing list pgsql-general

From gnari
Subject Re: Autoincremental value
Date
Msg-id 001301c4817c$d65b6c20$0100000a@wp2000
Whole thread Raw
In response to Autoincremental value  (adburne@asocmedrosario.com.ar)
List pgsql-general
"Josué Maldonado" <josue@lamundial.hn> wrote:
>
> El 13/08/2004 10:50 AM, adburne@asocmedrosario.com.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



pgsql-general by date:

Previous
From: David Garamond
Date:
Subject: psql wishlist: value completion
Next
From: Steve Crawford
Date:
Subject: Re: psql wishlist: value completion