X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 9AE41D1B481 for ; Tue, 6 Jan 2004 14:38:35 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 84095-05 for ; Tue, 6 Jan 2004 10:37:54 -0400 (AST) Received: from server5.safe-entry.net (unknown [69.56.186.2]) by svr1.postgresql.org (Postfix) with SMTP id 5BFE0D1B46E for ; Tue, 6 Jan 2004 10:37:29 -0400 (AST) Received: (qmail 28750 invoked from network); 6 Jan 2004 14:44:21 -0000 Received: from unknown (HELO bandeng) (202.146.237.165) by 0 with SMTP; 6 Jan 2004 14:44:21 -0000 Message-ID: <011801c3d462$c3019450$0200a8c0@bandeng> From: "Ricky" To: "postgre" Subject: trigger or rule? Date: Tue, 6 Jan 2004 18:54:12 +0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.3 tagged_above=0.0 required=5.0 tests=DATE_IN_PAST_03_06 X-Spam-Level: X-Archive-Number: 200401/8 X-Sequence-Number: 3637 hello, i want to ask a simple question. i tried to make validation in postgre when data = NULL then data will be changed into 0 so what should i do? using rule or trigger ? i already tried using rule : CREATE RULE synsellingprice_kosongtozero AS ON UPDATE TO synsellingprice DO UPDATE synsellingprice SET sellingprice = 0 WHERE (synsellingprice.productid = new.productid); when i tried to update, then error said 1"ERROR: query rewritten 100 times, may contain cycles" pls give me advices Thanks you very much Ricky