Re: autoupdating mtime column

From: "David Garamond" <davidgaramond(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: autoupdating mtime column
Date: 2006-08-04 15:11:14
Message-ID: 7c33d060608040811s6dcaa3abia137188076a76781@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On 8/4/06, Richard Huxton <dev(at)archonet(dot)com> wrote:
>
> David Garamond wrote:
> > Dear all,
> >
> > Please see SQL below. I'm already satisfied with everything except I
> > wish in
> > #4, mtime got automatically updated to NOW() if not explicitly SET in
> > UPDATE
> > statement. Is there a way to make the mtime column behave more like I
> > wanted? Thanks in advance.
>
> Just check for OLD.mtime = NEW.mtime, or am I missing something here?
>

How do I differentiate between:

UPDATE t SET mtime=mtime ...;

in which mtime is specifically set and should not change, and

UPDATE t SET foo=bar ...;

in which mtime is not mentioned and should be updated automagically to
NOW().

--
dave

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Rodrigo De León 2006-08-04 15:39:07 Re: autoupdating mtime column
Previous Message Richard Huxton 2006-08-04 12:49:06 Re: autoupdating mtime column