INSERT rule - Mailing list pgsql-hackers

From Darko Prenosil
Subject INSERT rule
Date
Msg-id 200406291251.19171.darko.prenosil@finteh.hr
Whole thread Raw
Responses Re: INSERT rule
List pgsql-hackers
Just wrote a function that takes view name as argument and generates INSERT, 
UPDATE and DELETE rules for that view. It is working OK (thanks to Tom), but 
I have trouble with INSERT rule. 
When inserting directly into table, default values are filled in when the 
field is not in the insert target list, but when using rule system field is 
filled with NULL. I understand that rule system rewrites the query as in 
CREATE RULE expression, but can I somehow detect actual attributes that are 
inserted, and avoid forced NULL inserts ? Tom said that current CVS support passing RECORD as an argument into the 
function. Is it good Idea to generate generic RULES that are simply passing 
NEW and OLD into some function, and try to solve updates inside that generic 
function ( instead of enumerating fields directly in CREATE RULE 
expression) ?

Any suggestions ?

(Sorry for bad English)
Regards !


pgsql-hackers by date:

Previous
From: Hannu Krosing
Date:
Subject: Re: Custom type with width specifier
Next
From: Christopher Kings-Lynne
Date:
Subject: Re: recursive SQL