Re: [GENERAL] What to do with no foreign keys

From: Sferacarta Software <sferac(at)bo(dot)nettuno(dot)it>
To: pgsql-general(at)postgreSQL(dot)org, Brian <signal(at)shreve(dot)net>
Subject: Re: [GENERAL] What to do with no foreign keys
Date: 1998-07-10 10:38:18
Message-ID: 0526.980710@bo.nettuno.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello Brian,

giovedì, 9 luglio 98, you wrote:

B> If I have two tables, which are like this:

B> baseball_team
B> -------------
B> team_name
B> number_of_players
B> games_played
B> total_runs

B> baseball_game
B> -------------
B> home_team_name
B> visitor_team_name
B> home_runs
B> visitor_runs

B> How can I insure that for example "home_team_name" is one of
B> "baseball_team.team_name"?

B> I have seen in books things like:

B> PRIMARY KEY: home_team
B> FOREIGN KEY: home_team JOIN TO baseball_team.team_name

B> is there anyway to do this in postgresql? Bascially I have like 12 tables,
B> and alot of them have a field "username". I want to insure that
B> "username" in all tables, is a valid username in "passwd.username".

B> Brian

B> /-------------------------- signal(at)shreve(dot)net -----------------------------\
B> | Brian Feeny | USR TC Hubs | ShreveNet Inc. (318)222-2638 |
B> | Network Administrator | Perl, Linux | Web hosting, online stores, |
B> | ShreveNet Inc. | USR Pilot | Dial-Up 14.4-56k, ISDN & LANs |
B> | 89 CRX DX w/MPFI, lots of |-=*:Quake:*=-| http://www.shreve.net/ |
B> | mods/Homepage coming soon |LordSignal/SN| Quake server: 208.206.76.47 |
B> \-------------------------- 318-222-2638 x109 -----------------------------/

Take a look at .../contrib/spi/refint.example.

Best regards,
Jose' mailto:sferac(at)bo(dot)nettuno(dot)it

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Tong 1998-07-10 13:13:21 Re: [GENERAL] What to do with no foreign keys
Previous Message Maarten Boekhold 1998-07-10 07:51:34 Re: [GENERAL] Moving Databases