Received: from news.tht.net (news.hub.org [216.126.91.242]) by postgresql.org (8.11.3/8.11.4) with ESMTP id fACJbfm24928 for ; Mon, 12 Nov 2001 14:37:42 -0500 (EST) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.4/8.11.4) id fACJ7g718459 for pgsql-sql@postgresql.org; Mon, 12 Nov 2001 14:07:42 -0500 (EST) (envelope-from news) From: Orion X-Newsgroups: comp.databases.postgresql.sql Subject: Funny Parse Error on Insert Date: Mon, 12 Nov 2001 11:12:18 -0800 Organization: TrustCommerce Lines: 20 Message-ID: <9sp6lt$huk$1@news.tht.net> Reply-To: o2@trustcommerce.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Complaints-To: scrappy@hub.org User-Agent: KNode/0.6.1 To: pgsql-sql@postgresql.org X-Archive-Number: 200111/192 X-Sequence-Number: 5576 I am getting a parse error on insert and I cant tell why. Anyone better at SQL what to lend me a hand? I'm just doing a simple 'INSERT INTO table (x,y) SELECT ...' Here's my statement and the error. fdb=> INSERT INTO mfps_action_codes_394 (code,description) SELECT '$','Dun Notice Printed' WHERE NOT EXISTS (SELECT 1 FROM mfps_action_codes_394 WERE code = '$'); ERROR: parser: parse error at or near "code" Note if I remove the WHERE clause from the SELECT it works... fdb=> INSERT INTO mfps_action_codes_394 (code,description) SELECT '$','Dun Notice Printed'; INSERT 9751582 1 Why would this happen?