Proper Join and check - Mailing list pgsql-general

From Patrick Nelson
Subject Proper Join and check
Date
Msg-id 4165C48DE9A0D211B6400800095C585F172E67@WASHINGTON
Whole thread Raw
Responses Re: Proper Join and check
List pgsql-general
If I have a one to many relation set on sym in each table is like... say
this:

CREATE TABLE "tableone" (
 "sym" varchar(5) NOT NULL,
 PRIMARY KEY ("sym") );

and

CREATE TABLE "tablemany" (
 "id"  int4       NOT NULL DEFAULT nextval('res_id_seq'::text),
 "sym" varchar(5) REFERENCES tableone ON UPDATE CASCADE,
 PRIMARY KEY ("id") );

Now these tables hold a lot of data so I want to do this correctly.  How do
I find the records in tableone that don't have any corresponding records in
tablemany?  In my application this shouldn't happen accept during the
initial inserting in tableone which briefly is followed by inserting in
tablemany.

pgsql-general by date:

Previous
From: Oleg Bartunov
Date:
Subject: Re: multi-column btree index for real values
Next
From: Patrick Nelson
Date:
Subject: Re: Proper Join and check