Rule problem

From: "Kiarash Bodouhi" <kbodouhi(at)yahoo(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Rule problem
Date: 2004-10-10 14:56:30
Message-ID: 002b01c4aed9$54ea3d30$0a00a8c0@kibotop2
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello all

I tried to use following rule instead of using a default value(I want to be
able to put a function instead of the constant value later on). But it keeps
giving me infinite recursion error. Any ideas?

CREATE OR REPLACE RULE "INSERT" AS

ON INSERT TO customer_rate where new.code is null DO INSTEAD INSERT INTO
customer_rate (prefix, rate, name, code,groupid)

VALUES (new.prefix, new.rate, new.name,'1',new.groupid);

Thanking you in advance

Regards

Kia

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Eugeny Balakhonov 2004-10-10 15:12:51 Change query priority
Previous Message Andrew Sullivan 2004-10-10 14:40:46 Re: mirroring/replication