Re: Trigger question - Mailing list pgsql-sql

From Dave Wedwick
Subject Re: Trigger question
Date
Msg-id 3A8A9EF5.8C8929C@wedwick.com
Whole thread Raw
In response to Trigger question  (Dave Wedwick <news@wedwick.com>)
List pgsql-sql
One person suggested setting now() as default.

That would work sometimes, but I have a situation where the user program is
updating the default field with 0.  now() never gets into the field.

So, regardless of what the user enters, I want now() to be updated, and I
guess it would be via a trigger...

Thanks!

Dave Wedwick wrote:

> Hi!
>
> I have a table with an int4 field called inserttime.  Regardless of what
> the user enters in this field, I want a trigger to put now() into it.
>
> What's the syntax for the trigger?
>
> Thanks!



pgsql-sql by date:

Previous
From: Josh Berkus
Date:
Subject: Re: how to select * from database1 table,database2 table
Next
From: Jie Liang
Date:
Subject: Re: constraint/restrict