RefLib

Reference library for AI

Back

postgresql_16:9.6.41.4 moddatetime — Functions for Tracking Last Modification Time

PostgreSQL 16 > Appendixes > Additional Supplied Modules and Extensions > spi — Server Programming Interface features/examples > moddatetime — Functions for Tracking Last Modification Time

moddatetime() is a trigger that stores the current time into a timestamp field. This can be useful for tracking the last modification time of a particular row within a table.

To use, create a BEFORE UPDATE trigger using this function. Specify a single trigger argument: the name of the column to be modified. The column must be of type timestamp or timestamp with time zone.

There is an example in moddatetime.example.

Back