I would like to track when an existing row is updated with a new column value.
For example, table:
CREATE TABLE mytable (
ts_event TIMESTAMP,
v_1 LONG,
v_2 INT,
ts_created TIMESTAMP,
ts_modified TIMESTAMP
)
timestamp(ts_event)
PARTITION BY WEEK
DEDUP UPSERT KEYS(ts_event);
contains row:
ts_event | v_1 | v_2 | ts_created | ts_modified
2022-01-01T12:00:00Z | 3 | 15 | 2023-02-01T08:00:00Z | NULL
Can I configure the table so that if an existing ‘ts_event’ row is updated with any new values, QuestDB automatically fills in the ‘ts_modified’ column with the now() timestamp (e.g.: 2024-03-02T09:00:00Z), like so:
ts_event | v_1 | v_2 | ts_created | ts_modified
2022-01-01T12:00:00Z | 4 | 15 | 2023-02-01T08:00:00Z | 2024-03-02T09:00:00Z
Note, do not update the ‘ts_modified’ column if the row is unchanged.
I am using the Python ingress client, e.g.: questdb.Sender() dataframe() method to ingest data into the table.
Thanks in advance,
-Lars