Received: from news.tht.net (news.hub.org [216.126.91.242]) by postgresql.org (8.11.3/8.11.4) with ESMTP id fAD9bgm02450 for ; Tue, 13 Nov 2001 04:37:43 -0500 (EST) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.4/8.11.4) id fAD9UOs28340 for pgsql-sql@postgresql.org; Tue, 13 Nov 2001 04:30:24 -0500 (EST) (envelope-from news) From: Brian@McSweeney.iol.ie (Brian) X-Newsgroups: comp.databases.postgresql.sql Subject: INSERT question Date: 13 Nov 2001 01:30:22 -0800 Organization: http://groups.google.com/ Lines: 15 Message-ID: <1f5f2b44.0111130130.17e8e57a@posting.google.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Complaints-To: groups-abuse@google.com To: pgsql-sql@postgresql.org X-Archive-Number: 200111/193 X-Sequence-Number: 5577 Hi everyone, I've a little question about using insert statements. I've got a parent table with a "serial" (automatically incrementing integer) primary key. I have a child table with a foreign key which references that primary key. My question is: To insert values into the child table corresponding to an entry in the parent table, how do I get a reference to the serial primary key (so as I can reference it for the foreign key entry) Hope you understand what I mean. This should be a regular occurance and seeing as I'm not an sql guru, I just don't have a clue! Any help would be SOOO appreciated. Brian