For example, consider the table
create table foo (
contents text NOT NULL,
is_active boolean NOT NULL DEFAULT false,
dt_active date
)
I insert an entry:
insert into foo (contents) values ('bar')
So far so good. Later I now want to “activate” the entry:
update foo set is_active = true
What I would like to do, if is_activechanged from falseto true, is dt_activeset to now(). For bonus points, it would be nice if is_activechanged from trueto false, dt_active is set to null, but I can live without it.
I would really like this household to be uploaded to the database, this would make the client code cleaner (since many tables (and even column tuples in the tables) could use this technique).
, ( plpgsql), "" "". .