database design SQL prob. - Mailing list pgsql-sql

From Frederic.De.Leersnijder@pandora.be
Subject database design SQL prob.
Date
Msg-id 199907221247.IAA52530@hub.org
Whole thread Raw
List pgsql-sql
The idea of the table below is to keep track of members. They have to register themself so I want to prevent them from
subscribingtwice. That's why I used a primary key on the fields firstname, lastname, adres, zipcode. But I would really
wantmember_id to be my primary key as the table is referenced by other tables. Can I make firstname, lastname... a
uniquevalue in another way? 
Like constraint UNIQUE (firstname, lastname,adres,zipcode)
I just made that last one up but is it possible to enforce the uniqueness of a couple of fields together?

CREATE TABLE "member" (
    "member_id" int4 DEFAULT nextval ( 'lid_id_seq' ) UNIQUE NOT NULL,
    "firstname" text,
    "lastnaam" text,
    "adress" text,
    "zipcoder" character(4),
    "telephone" text,
    "email" text,
    "registration_date" date DEFAULT current_date NOT NULL,
    "student_id" text,
    "dep_id" text,
    "password" text NOT NULL,
    "validated" bool DEFAULT 'f' NOT NULL,
    PRIMARY KEY (firstname, lastname, adres, zipcode));

pgsql-sql by date:

Previous
From: root
Date:
Subject: (no subject)
Next
From: "D'Arcy" "J.M." Cain
Date:
Subject: Re: [SQL] calculating percentages