| From: | ngterry <ngterry(at)sinaman(dot)com> |
|---|---|
| To: | <pgsql-general(at)postgresql(dot)org> |
| Subject: | re: REFERENCES |
| Date: | 2002-03-10 15:40:40 |
| Message-ID: | 20020310234040.1289.qmail@hk.sina.com.hk |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
Hi!
I am just a newbie in postgresql. What if:
CREATE TABLE purchase (id int, po int, date date, PRIMARY KEY (id));
CREATE TABLE lcopen (lc numeric, po int, PRIMARY KEY (lc));
CREATE TABLE lcreceive (id int, lc numeric REFERENCES lcopen, purid int REFERENCES purchase);
How do I refer the keywords po in table lcopen to table purchase the po keywords? I am quite confuse, since I have announce id in table purchase as PRIMARY KEY. I do not know how to key another keywords.
Best regards,
Terence
==================================================================
新浪SMS短訊:http://sms.sina.com.hk
給遠方親友傳上無限驚喜
50MB 電子郵件 :http://sinamail.sina.com.hk
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tom Lane | 2002-03-10 16:02:02 | Re: Referential Integrity Triggers |
| Previous Message | Paul | 2002-03-10 14:22:59 | Transaction on start of session ? |