postgresql 9.2 - Simple Static Update Trigger I Postgres -
i have created simple static update trigger in postgres given below.
create or replace function public.trig_update () returns trigger $body$ begin insert update_log values((select column_name information_schema.columns table_name='book'),old.column_name,new.column_name); return new; end $body$ language 'plpgsql'
above functions works correctly if manually enter respective column after 'old.' & 'new.' statements when columns in particular table more manual entry time consuming & not dynamic.
hence above used select statement accepting columns particular table gives error
error: record "old" has no field "column_name"
any solution same??
Comments
Post a Comment