On Thursday 10 March 2005 02:09 pm, Henry Ortega wrote:
> I have the following table
>
> FIELD_A | FIELD_B | TSTAMP
> ---------------------------------------------------------------------------
>----------------------------- x y
> 2005-03-10 14:56:47.456431
>
> TSTAMP = not null default now()
>
> What's the best way to always auto-update TSTAMP to it's
> default value whenever the row gets updated?
> (e.g. update TABLENAME set FIELD_A='zzz' where FIELD_A='x';
> should automatically set TSTAMP to now)
>
trigger on update/insert.
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faq
--
Larry Rosenman http://www.lerctr.org/~ler
Phone: +1 214-351-4152 E-Mail: ler@lerctr.org
US Mail: 3535 Gaspar Drive, Dallas, TX 75220-3611