Re: best way to auto-update a field when row is updated
От | Larry Rosenman |
---|---|
Тема | Re: best way to auto-update a field when row is updated |
Дата | |
Msg-id | 200503101421.33958.ler@lerctr.org обсуждение исходный текст |
Ответ на | best way to auto-update a field when row is updated (Henry Ortega <juandelacruz@gmail.com>) |
Список | pgsql-sql |
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
В списке pgsql-sql по дате отправления: