-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sql: feature request: auto-refill column upon update of another column #28281
Comments
I brought this up in the forum. I believe in Postgre world, this needs to handle with trigger. CRDB does not have trigger now, but I believe the last modified date for a row is a very needed feature. Are there any internal/hidden column which contains this info? |
some ping after almost 2 years now :) |
I think this wouldn't be too hard to implement. It would insert into the executed query an update for all the onUpdate configured columns (probably similar to comments?) and the rest doesn't needs to be touched. So it needs additional metadata and similar action like defaultValue for inserting data. |
@rafiss Can this be closed? |
This is solved, we added |
Now how do I Automatically update the timestamp? |
FEATURE REQUEST
Please describe the feature you are requesting, as well as your proposed use case.
From the forum: https://forum.cockroachlabs.com/t/on-update-current-timestamp/1895
We currently support
DEFAULT current_timestamp()
when creating a table, but do not support the additionalON UPDATE current_timestamp()
default, as described here in the mysql docs: https://dev.mysql.com/doc/refman/8.0/en/timestamp-initialization.html. The consequence (I believe) is that users would need to manage updates in app in order to adopt CRDB.Jira issue: CRDB-4916
The text was updated successfully, but these errors were encountered: