How to make the key in table increase automatically?

From: Mathias Göthberg <s97math(at)student(dot)informatik(dot)gu(dot)se>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: How to make the key in table increase automatically?
Date: 2000-08-24 18:24:32
Message-ID: 000f01c00df8$92989ea0$912cc6c3@1an
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

How to make the key in a table increase automatically with 1 every time a new row is added?

That is, when I add a new row with all attributes except the primary key, I want the primary key in that row to have a unique number that is 1 higher than the previous row.

Mathias

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Anthony E . Greene 2000-08-24 22:28:28 Re: Host IP
Previous Message Dan Manczak 2000-08-24 17:42:23 total newbie: Compilation & Install