Re: Update Trigger Inconsistency with 7.1? - Mailing list pgsql-general

From Gregory Wood
Subject Re: Update Trigger Inconsistency with 7.1?
Date
Msg-id 001201c087d4$8becc3a0$7889ffcc@comstock.com
Whole thread Raw
In response to Update Trigger Inconsistency with 7.1?  ("Gregory Wood" <gregw@com-stock.com>)
List pgsql-general
> You can detect whether a field is actually being *changed* by comparing
> NEW.field and OLD.field.  You cannot distinguish the case where the
> UPDATE didn't mention a field from the case where it did but assigned
> the same value that was already there (eg UPDATE foo SET x = x).
> This behavior was not different in 7.0.

I had thought that I tested by trying update statements where the field
wasn't specified. I suppose I probably am overlooking some other fact that
was causing it to fail, but I could've sworn...

I suppose I'll have to NULL out the field on INSERTs and UPDATEs, or push it
into yet another field, then check for NULLness every time to verify that
it's updated. Sigh.

Greg



pgsql-general by date:

Previous
From: "Martin A. Marques"
Date:
Subject: Re: PostgreSQL 7 on Redhat 6.1
Next
From: "Dan Wilson"
Date:
Subject: Weird View behavior