Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 17E3F475A1E for ; Thu, 28 Nov 2002 15:44:36 -0500 (EST) Received: from sccrmhc01.attbi.com (sccrmhc01.attbi.com [204.127.202.61]) by postgresql.org (Postfix) with ESMTP id BE97F475AFF for ; Thu, 28 Nov 2002 15:44:34 -0500 (EST) Received: from Ranger (12-230-12-232.client.attbi.com[12.230.12.232]) by sccrmhc01.attbi.com (sccrmhc01) with SMTP id <2002112820443500100qopg8e>; Thu, 28 Nov 2002 20:44:35 +0000 Content-Type: text/plain; charset="us-ascii" From: Adrian Klaver To: pgsql-general@postgresql.org Subject: Trigger Date: Thu, 28 Nov 2002 12:35:42 -0800 User-Agent: KMail/1.4.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200211281235.42714.aklaver@attbi.com> X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200211/1395 X-Sequence-Number: 33814 I have created the following function: CREATE OR REPLACE FUNCTION validate_tag_number() RETURNS OPAQUE AS ' BEGIN IF new.tag_number=old.tag_number THEN RAISE EXCEPTION " number is already present"; END IF; RETURN NEW; END; 'LANGUAGE 'plpgsql'; I used it to create a trigger as follows; CREATE TRIGGER validate_tag_number BEFORE UPDATE ON tag_vendor FOR EACH ROW EXECUTE PROCEDURE validate_tag_number(); If I do an update with a tag_number that does not exist everything is fine. If I do an update with a preexisting number I get the following messages- NOTICE: plpgsql:ERROR during compile of validate_tag_number line 3 ERROR: unterminated " in name " I was expecting to get the "number is already present" error messsage. Where is my error? Thank you Adrian Klaver