Re: Odd on-update inconsistency

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Richard Huxton <dev(at)archonet(dot)com>
Cc: Steve Crawford <scrawford(at)pinpointresearch(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Odd on-update inconsistency
Date: 2008-11-26 21:17:27
Message-ID: 25067.1227734247@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Richard Huxton <dev(at)archonet(dot)com> writes:
> Steve Crawford wrote:
>> I'm having trouble understanding something I saw in my data from
>> yesterday involving an inconsistency between values in a table and its
>> associated rule-updated log table.
>>
>> For application debugging purposes (effectiveness of web double-submit
>> suppression) we have a rule that creates an entry in a log table
>> whenever the table we are watching is updated:

> Ah, I think you'll find you don't. You have a rule that looks at first
> glance like it *should* add an entry to your log table.

We'd have to see the original query (the one the rule acted on) to be
sure, but I suspect Richard's diagnosis is correct.

> For inserting to a log table you'll want a trigger.

+1 ... triggers are way less likely to do strange things.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2008-11-26 21:22:36 Re: pg_get_serial_sequence Strangeness/Unreliable?
Previous Message Jaime Casanova 2008-11-26 21:16:25 Re: pg_get_serial_sequence Strangeness/Unreliable?