Thread: How do you detect row version changes in PostgreSQL?

How do you detect row version changes in PostgreSQL?

From
"Craig Manley"
Date:
Hi all,
Some databases have a hidden field that contains a row version key.
Everytime an update is performed on a row the value of the version field
changes. Does PostgreSQL have a similar hidden field? If not then I guess
using a before update trigger that modifies a user defined field will
provide an alternative solution.
Greetings,
Craig Manley.


Re: How do you detect row version changes in PostgreSQL?

From
Tom Lane
Date:
"Craig Manley" <bitneuker666@hotmail.com> writes:
> Some databases have a hidden field that contains a row version key.
> Everytime an update is performed on a row the value of the version field
> changes. Does PostgreSQL have a similar hidden field?

See xmin (and also cmin if you need to keep track of multiple changes
intra-transaction).  It might not be defined quite the way you want,
but if you're not picky about what a "version number" is, it'll do.
        regards, tom lane