problem using trigger

From: "shreedhar" <shreedhar(at)lucidindia(dot)net>
To: "PostgreSQL" <pgsql-admin(at)postgresql(dot)org>
Subject: problem using trigger
Date: 2002-05-10 05:03:26
Message-ID: 001201c1f7e0$04e5ab60$1201a8c0@a4005
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

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.

Browse pgsql-admin by date

  From Date Subject
Next Message Nick Fankhauser 2002-05-10 14:11:57 A couple of errors encountered in 7.1.3=>7.2.1-2 data migration
Previous Message Marcelo Henrique da Silva 2002-05-09 17:59:50 PAM Authentication