Re: Autoincremental value

From: Josué Maldonado <josue(at)lamundial(dot)hn>
To: adburne(at)asocmedrosario(dot)com(dot)ar
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Autoincremental value
Date: 2004-08-13 20:11:27
Message-ID: 411D206F.7010701@lamundial.hn
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

El 13/08/2004 10:50 AM, adburne(at)asocmedrosario(dot)com(dot)ar en su mensaje
escribio:
> Hi I'm a newbie in postgresql, I came from MSSQL, MySQL and now
> I'm testing postgres.
> In mysql there is a way to make a second autoincrement field, just:
>
> create table table1
> (field1 integer,
> field2 integer autoincrement,
> primary key (field1,field2))
>
> when insert rows:
>
> 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.

--
Sinceramente,
Josué Maldonado.

"Y conoceréis la verdad, y la verdad os hará libres." San Juan 8-32.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Allison 2004-08-13 20:32:01 Re: PostgreSQL 8.0 Feature List?
Previous Message Bruno Wolff III 2004-08-13 20:09:23 Re: Autoincremental value