Re: How to know a table has been modified?

Поиск
Список
Период
Сортировка
От Lennin Caro
Тема Re: How to know a table has been modified?
Дата
Msg-id 1330370933.29755.YahooMailClassic@web162202.mail.bf1.yahoo.com
обсуждение исходный текст
Ответ на Re: How to know a table has been modified?  (Tatsuo Ishii <ishii@postgresql.org>)
Список pgsql-hackers
<table border="0" cellpadding="0" cellspacing="0"><tr><td style="font: inherit;" valign="top"><div
class="almost_half_cell"id="gt-res-content"><div dir="ltr" style="zoom:1"><span class="" id="result_box"
lang="en"><spanclass="hps">you're right</span><span class="">, changes</span> <span class="hps">in cascading</span>
<spanclass="hps">tables</span> <span class="hps">are not logged.<br /><br /><br /></span></span></div></div><br /><hr
style="width:100%; height: 2px;" /><br />Ing. Lennin Caro Pérez<br /> Usuario:GNU/LINUX<br /> PHP Developer<br />
PostgreSQLDBA<br /> Oracle DBA<br /> Linux counter id 474393<br /><br />--- On <b>Mon, 2/27/12, Tatsuo Ishii
<i><ishii@postgresql.org></i></b>wrote:<br /><blockquote style="border-left: 2px solid rgb(16, 16, 255);
margin-left:5px; padding-left: 5px;"><br />From: Tatsuo Ishii <ishii@postgresql.org><br />Subject: Re: [HACKERS]
Howto know a table has been modified?<br />To: lennin.caro@yahoo.com<br />Cc: Kevin.Grittner@wicourts.gov,
pgsql-hackers@postgresql.org<br/>Date: Monday, February 27, 2012, 4:05 PM<br /><br /><div class="plainMail">Are you
suggestinglog_statement? I don't think it's a solution by<br />following reasons:<br /><br />1) it's slow to enable
thaton busy systems<br />2) tables affected by cascading delete/update/drop is not logged in<br />   PostgreSQL log<br
/>--<br/>Tatsuo Ishii<br />SRA OSS, Inc. Japan<br />English: <a href="http://www.sraoss.co.jp/index_en.php"
target="_blank">http://www.sraoss.co.jp/index_en.php</a><br/>Japanese: <a href="http://www.sraoss.co.jp"
target="_blank">http://www.sraoss.co.jp</a><br/><br />> check the log of postgresql, there you can take the table
nameand the date of the modification<br />> <br />> <br />> Ing. Lennin Caro Pérez<br />> <br />>
Usuario:GNU/LINUX<br/>> <br />> PHP Developer<br />> <br />> PostgreSQL DBA<br />> <br />> Oracle
DBA<br/>> <br />> Linux  counter id 474393<br />> <br />> --- On Mon, 2/27/12, Tatsuo Ishii <<a
href="/mc/compose?to=ishii@postgresql.org"ymailto="mailto:ishii@postgresql.org">ishii@postgresql.org</a>> wrote:<br
/>><br />> From: Tatsuo Ishii <<a href="/mc/compose?to=ishii@postgresql.org"
ymailto="mailto:ishii@postgresql.org">ishii@postgresql.org</a>><br/>> Subject: Re: [HACKERS] How to know a table
hasbeen modified?<br />> To: <a href="/mc/compose?to=Kevin.Grittner@wicourts.gov"
ymailto="mailto:Kevin.Grittner@wicourts.gov">Kevin.Grittner@wicourts.gov</a><br/>> Cc: <a
href="/mc/compose?to=pgsql-hackers@postgresql.org"
ymailto="mailto:pgsql-hackers@postgresql.org">pgsql-hackers@postgresql.org</a><br/>> Date: Monday, February 27,
2012,12:04 PM<br />> <br />>>> For TRIGGER, I cannot thinking of any way. Any idea will be<br
/>>>>welcome.<br />>>  <br />>> It would require creating "cooperating" triggers in the database
and<br/>>> having a listener, but you might consider the<br />>> triggered_change_notifications() trigger
functionincluded in 9.2. <br />>> It works at least as far back as 9.0; I haven't tried it any further<br
/>>>back.<br />> <br />> Thanks for the info. It's a little bit overkill for my purpose though.<br />>
(onbusy systems, the notification would be too frequent).<br />> <br />> I would think that creating a small
routineperiodically consults<br />> pg_stat_all_tables view and records the last update datetime for each<br />>
table(unfortunately the view does not have last modification date).<br />> --<br />> Tatsuo Ishii<br />> SRA
OSS,Inc. Japan<br />> English: <a href="http://www.sraoss.co.jp/index_en.php"
target="_blank">http://www.sraoss.co.jp/index_en.php</a><br/>> Japanese: <a href="http://www.sraoss.co.jp"
target="_blank">http://www.sraoss.co.jp</a><br/>> <br />> -- <br />> Sent via pgsql-hackers mailing list (<a
href="/mc/compose?to=pgsql-hackers@postgresql.org"
ymailto="mailto:pgsql-hackers@postgresql.org">pgsql-hackers@postgresql.org</a>)<br/>> To make changes to your
subscription:<br/>> <a href="http://www.postgresql.org/mailpref/pgsql-hackers"
target="_blank">http://www.postgresql.org/mailpref/pgsql-hackers</a><br/></div></blockquote></td></tr></table> 

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Dimitri Fontaine
Дата:
Сообщение: Re: Command Triggers, patch v11
Следующее
От: Thom Brown
Дата:
Сообщение: Re: Command Triggers, patch v11