Thread: problem using trigger

problem using trigger

From
"shreedhar"
Date:
Hi All,

It is not a Admin question, But it is part of Administration. I would like
store details of groups as well as users in to my dummy table as i inserted
into pg_user as well as pg_group.

for that i created a dummy table for pg_group with same structure.

gdump;

i created a function aa_insertgdump with the following script

No input parameters, return value is integer, language plpgsql

declare
 gid integer;
begin
 select max(grosysid) into gid from pg_group;
 insert into gdump select * from pg_group where grosysid = gid);
 return 1;
end;

I thought of executing  this function using a trigger after insertion into
pg_group.

create trigger gdumptable after insert on pg_group for each row execute
procedure aa_insertgdump();

but, it is giving error as "can't create trigger for system relation
pg_group".

Can any one suggest what is the solution to my problem.

regards,
bhaskarraju.