Unique Number KEY - Mailing list pgsql-sql

From Patrice DUMAS
Subject Unique Number KEY
Date
Msg-id 000901be61af$7018d800$ce9efea9@blneige
Whole thread Raw
List pgsql-sql
Hello,

What is the best way, with PostGres, to create a Unique Number Key
Generator?


For example, I have a STUDENTS table:
{
    StudentNumber    integer;
    StudentName      char[40];
...
}

Beginner in SQL, I think I must use Primary key or something like that, to
be sure StudentNumber is unique.
But, I want StudentNumber to be generated automatically, the user don't
worry in assigning a StudentNumber.

What is the best way to do that with PostGres-SQL ?

Thank you for your answers and sorry for my poor english,




Patrice DUMAS
Ardèche, FRANCE.
pdumas@inforoutes-ardeche.fr



pgsql-sql by date:

Previous
From: Remigiusz Sokolowski
Date:
Subject: Re: [SQL] CREATE TABLE
Next
From: CIMPOESU Teodor
Date:
Subject: Re: [SQL] Unique Number KEY