INSERT rule
От | Darko Prenosil |
---|---|
Тема | INSERT rule |
Дата | |
Msg-id | 200406291251.19171.darko.prenosil@finteh.hr обсуждение исходный текст |
Ответы |
Re: INSERT rule
|
Список | 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 по дате отправления: