Re: Update Trigger Inconsistency with 7.1?

From: "Gregory Wood" <gregw(at)com-stock(dot)com>
To: "PostgreSQL-General" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Update Trigger Inconsistency with 7.1?
Date: 2001-01-26 20:14:09
Message-ID: 001201c087d4$8becc3a0$7889ffcc@comstock.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Dan Wilson 2001-01-26 20:46:08 Weird View behavior
Previous Message Martin A. Marques 2001-01-26 20:06:25 Re: PostgreSQL 7 on Redhat 6.1