From: | "David Hartwig" <daybee(at)bellatlantic(dot)net> |
---|---|
To: | "Robert Williams" <rwilliams(at)jrc-utah(dot)com>, "Postgres" <pgsql-general(at)postgreSQL(dot)org> |
Subject: | Re: [GENERAL] auto increment? |
Date: | 1999-01-23 23:22:20 |
Message-ID: | 006501be4727$3a6ef740$027dc497@daveh |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Each PostgreSQL table has a, system assigned, oid (object ID) column which
is useful for uniquely identifying rows. Users have vertually no control
over it value.
There is also:
CREATE TABLE foo (
ai serial primary key,
bar integer
);
which is a short cut in the parser for:
CREATE SEQUENCE ai_seq;
CREATE TABLE foo (
ai integer default nextval('ai_seq') primary key,
bar integer
);
The ai column in each create statement does not require the user code to
explicitly assign its values.
See CREATE_SEQUENCE in the doc.
----- Original Message -----
From: Robert Williams <rwilliams(at)jrc-utah(dot)com>
To: Postgres <pgsql-general(at)postgreSQL(dot)org>
Sent: Saturday, January 23, 1999 4:11 PM
Subject: [GENERAL] auto increment?
>How do I set up a column as auto increment? I have looked
>everywhere for the postgres equivalent ROWID as in Oracle.
>
>--
>Robert Williams rwilliams(at)jrc-utah(dot)com
>Jarob Consulting rwilliams(at)kde(dot)org
>Provo, Utah rwilliams71(at)mailexcite(dot)com
From | Date | Subject | |
---|---|---|---|
Next Message | Robert Williams | 1999-01-24 00:28:20 | Re: [GENERAL] auto increment? |
Previous Message | Robert Williams | 1999-01-23 21:11:52 | auto increment? |