Rule problem - Mailing list pgsql-general

From Kiarash Bodouhi
Subject Rule problem
Date
Msg-id 002b01c4aed9$54ea3d30$0a00a8c0@kibotop2
Whole thread Raw
Responses Re: Rule problem  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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

 

pgsql-general by date:

Previous
From: Andrew Sullivan
Date:
Subject: Re: mirroring/replication
Next
From: "Eugeny Balakhonov"
Date:
Subject: Change query priority