X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 98963DB955 for ; Fri, 18 Nov 2005 09:35:55 -0400 (AST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 20599-09 for ; Fri, 18 Nov 2005 13:35:58 +0000 (GMT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail.metronet.co.uk (mail.metronet.co.uk [213.162.97.75]) by svr1.postgresql.org (Postfix) with ESMTP id F152CDB77A for ; Fri, 18 Nov 2005 09:35:52 -0400 (AST) Received: from mainbox.archonet.com (84-51-143-99.archon037.adsl.metronet.co.uk [84.51.143.99]) by smtp.metronet.co.uk (MetroNet Mail) with ESMTP id B20B842B584; Fri, 18 Nov 2005 13:35:35 +0000 (GMT) Received: from [192.168.1.17] (client17.office.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id 7619E15EA4; Fri, 18 Nov 2005 13:35:44 +0000 (GMT) Message-ID: <437DD8B0.6030509@archonet.com> Date: Fri, 18 Nov 2005 13:35:44 +0000 From: Richard Huxton User-Agent: Mozilla Thunderbird 1.0.7 (X11/20051013) X-Accept-Language: en-us, en MIME-Version: 1.0 To: aalam@tatashare.com Cc: pgsql-general@postgresql.org Subject: Re: trigger References: <001101c5ec31$c16b1420$ec1010ac@aftabn463> In-Reply-To: <001101c5ec31$c16b1420$ec1010ac@aftabn463> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[AWL=0.000] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200511/947 X-Sequence-Number: 87091 Aftab Alam wrote: > Hello, > > I want to create a trigger in PostgresSQL > > In trigger, Before inserting the record, if data is already in the table, > the trigger fire the mesaage that data is already there, and after that > trigger ckeck for next insert statement. Aftab - can you explain in some more detail. Raising an error on an insert will happen automatically if you violate a unique constraing. What is this "next insert statment" you're talking about? -- Richard Huxton Archonet Ltd