Trigger proglem - Mailing list pgsql-hackers

From Nikolay Grebnev
Subject Trigger proglem
Date
Msg-id a7cd64c30712101036h69b9bb77hd070bbd6d2044897@mail.gmail.com
Whole thread Raw
List pgsql-hackers
Good day,<br /><br />We have written a trigger that is <br /><br />We have written a trigger that is associated with
thetable. When any changes are submitted, then this trigger reconstruct and writes sql query to the table querieslog.
<br/><span style="background-color: rgb(255, 255, 255);">We have found a problem: from time to time some sql query is
notwritten while the query is executed . It is seen: In php where the queries are formed we see that the query is
sent</span>for execution and executed ant the base was modified, but the trigger seems just to skip it (does not work
withthe query). It is seen most in big tables and during big load of the server. <br />Current version of postgresql is
8.2.5.<br/><br />Description of the table where the queries are stored <br /> \d querieslog<br
/>                              <divclass="gmail_quote"><div class="Ih2E3d">         Table "public.querieslog"<br />  
Column  |           Type           |                           Modifiers <br
/>------------+--------------------------+---------------------------------------------------------------<br
/> query     | text                     |<br /> query_id   | bigint                   | not null default
nextval('querieslog_query_id_seq'::regclass)<br /> timequery  | timestamp with time zone | default now()<br
/> timeinsert| integer                  |<br />Indexes:<br />    "querieslog_query_id_index" btree (query_id)<br /><br
/></div>Theparameters of summoning the trigger for the table with one key: <br /></div><div class="Ih2E3d">pgr_iud_trig
BEFOREINSERT OR DELETE OR UPDATE ON phpbb_users FOR EACH ROW EXECUTE PROCEDURE pgr_iud('user_id')<br /><br /></div>For
thetahbles with several key fields - we write the list of keys with space between them <div class="Ih2E3d"><br
/>pgr_iud_trigBEFORE INSERT OR DELETE OR UPDATE ON mailing_list FOR EACH ROW EXECUTE PROCEDURE pgr_iud('user_id
mailing_id')<br /><br />cc -I /usr/local/pgsql/include</div><div class="gmail_quote"><div class="Ih2E3d">/server/ -fpic
-c-O3 repl.c<br />cc -shared -o pgr_iud.so repl.o<br /><br /></div>and repl.c itself - <a
href="http://www.grebnevs.com/trigger/repl.c">http://www.grebnevs.com/trigger/repl.c</a><br /><br /><br /><br /></div> 

pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: archive_command failures report confusing exit status
Next
From: Magnus Hagander
Date:
Subject: Re: Release Note Changes