Hi everyone,

I have some kind of strange problem. I want to build general parametrized 
trigger for my database. The parameter sent to the trigger contains a column 
name that trigger should be check.  

CREATE OR REPLACE FUNCTION F_T_IU__check() RETURNS trigger AS $$
        DECLARE
                vt VARCHAR;
        BEGIN
...........................................................
                        vt:='constant_value_id';
                        RAISE EXCEPTION 'aaa=%', NEW.vt;
.............................................................

The 'vt' variable contains the column name. In the above statement I want that 
NEW.vt to be interpreted as NEW.constant_value_id. It is possible to do this?

Thanks,
Nosy

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
       choose an index scan if your joining column's datatypes do not
       match

Reply via email to