X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 46B8552834 for ; Tue, 7 Jun 2005 03:44:44 -0300 (ADT) 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 41152-04 for ; Tue, 7 Jun 2005 06:44:41 +0000 (GMT) Received: from sharp.noc24x7.com (unknown [69.56.128.138]) by svr1.postgresql.org (Postfix) with ESMTP id 98D8F52896 for ; Tue, 7 Jun 2005 03:44:41 -0300 (ADT) Received: from [61.3.110.140] (helo=thenilgiris.web) by sharp.noc24x7.com with esmtp (Exim 4.50) id 1DfXpL-0005LP-A1; Tue, 07 Jun 2005 12:14:44 +0530 Received: by thenilgiris.web (Postfix, from userid 500) id 8DA055D4F2; Tue, 7 Jun 2005 12:13:37 +0530 (IST) From: Kenneth Gonsalves To: Nick Johnson Subject: Re: preventing deletion of a row Date: Tue, 7 Jun 2005 12:13:37 +0530 User-Agent: KMail/1.6.1 Cc: PostgreSQL SQL References: <200506071059.17689.lawgon@thenilgiris.com> <42A537B6.8040902@notdot.net> In-Reply-To: <42A537B6.8040902@notdot.net> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <200506071213.37155.lawgon@thenilgiris.com> X-Antivirus-Scanner: Clean mail though you should still use an Antivirus X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - sharp.noc24x7.com X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - thenilgiris.com X-Source: X-Source-Args: X-Source-Dir: X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.085 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200506/96 X-Sequence-Number: 21697 On Tuesday 07 Jun 2005 11:29 am, Nick Johnson wrote: > >if the value of 'fixed' is TRUE, then this row cannot be deleted. > > How do i enforce this condition? > > =C2=A0 > > Try this: > CREATE RULE tablename_delete AS ON DELETE TO tablename WHERE > OLD.fixed =3D TRUE DO INSTEAD NOTHING; cool - thanks =2D-=20 regards kg http://www.livejournal.com/users/lawgon tally ho! http://avsap.sourceforge.net =E0=B2=87=E0=B2=82=E0=B2=A1=E0=B3=8D=E0=B2=B2=E0=B2=BF=E0=B2=A8=E0=B2=95=E0= =B3=8D=E0=B2=B8 =E0=AE=B5=E0=AE=BE=E0=AE=B4=E0=AF=8D=E0=AE=95!