how to INSERT foreign keys? - Mailing list pgsql-novice

From Phil Mitchell
Subject how to INSERT foreign keys?
Date
Msg-id 4.3.2.7.2.20020210172848.00ac3bb0@pop.rcn.com
Whole thread Raw
Responses Re: how to INSERT foreign keys?
List pgsql-novice
I have an <items> table, and a <keys> table, and a map table that relates
item_id's to key_id's. How do I populate item_keys with data?

I tried:

INSERT INTO item_keys SELECT item_id from items where item = 'item 1',
SELECT key_id from keys where key = 'key 1';

but the parser doesn't like that.

Thanks!


pgsql-novice by date:

Previous
From: "Eric Peters"
Date:
Subject: Re: How would I make this into a stored procedure? (Solved)
Next
From: John Taylor
Date:
Subject: Re: Using indexes and keys