Row ID and auto-increment?

From: Raymond Chui <raymond(dot)chui(at)noaa(dot)gov>
To: pgsql-general(at)postgresql(dot)org
Subject: Row ID and auto-increment?
Date: 2001-02-14 21:08:12
Message-ID: 3A8AF3BB.C9370731@noaa.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

If I create a table like

create table tablename (
aNum integer not null,
name varchar(10)
);

If I do select * from tablename;

q1. Is there such thing rowid similar to Oracle in PostgreSQL?
q2. How do I make aNum auto increment by 1? Need to write
a trigger? how to write that?
I want to enforce column aNum 0,1,2,.....n.
I want to prevent data entry people input 0,1,4,5,8,...n.
Thank you very much in advance!

--Raymond

Attachment Content-Type Size
raymond.chui.vcf text/x-vcard 414 bytes

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Ansley 2001-02-14 21:24:02 RE: using tables as types in other tables
Previous Message The Hermit Hacker 2001-02-14 19:55:30 Re: News server not working?