Here is an example:
CREATE TABLE membershipextras
MemberID int4 NOT NULL DEFAULT 0,
Type char(1) NOT NULL DEFAULT '1',
PRIMARY KEY (MemberID, Type),
CONSTRAINT MembershipExtrasMemberID_fk FOREIGN KEY (MemberID) REFERENCES Membership(MemberID) ON DELETE CASCADE
From: Christian Anton [SMTP:christiananton(at)hotmail(dot)com]
Sent: Monday, April 30, 2001 10:10 PM
Subject: URGENT HELP NEEDED
I'm a college student in a db development course. I use postgres 7.03 on
RedHat 7.1, I need help setting foreign key constraints and I cannot find in
the doc's and I cannot access postgres.org. I have a db due literally
yesterday, if I can't get it in tomorrow I lose my hard earned 'A'.
I'm alomost sure I've done this before on Psql by simply stating
"CONSTRAINT YADDA_FK FOREIGN KEY (SHMACKITY) REFERENCES SHMACK(SMACKITY)"
Foreign key support is supposed to be in now right???
Please, cannot stress how important this is to me enough.
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
message can get through to the mailing list cleanly
pgsql-admin by date
|Next:||From: John Pagakis||Date: 2001-05-04 23:56:40|
|Subject: RE: Queries|
|Previous:||From: Bruce Momjian||Date: 2001-05-04 22:08:34|
|Subject: Re: Re: Use of the LIMIT clause ?|