Skip to content
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

Remove / deprecate use of now() from SQL insert statements #1083

Closed
dlebauer opened this issue Oct 14, 2016 · 1 comment · Fixed by #2583
Closed

Remove / deprecate use of now() from SQL insert statements #1083

dlebauer opened this issue Oct 14, 2016 · 1 comment · Fixed by #2583

Comments

@dlebauer
Copy link
Member

From Scott in terraref/computing-pipeline#174 (comment)

Please don't include the created_at and/or updated_at columns in the insert and update statements! A trigger function handles these automatically so that created_at and updated_at are set to the current time when a row is inserted, and updated_at is reset to the current time when a row is updated. Setting them explicitly overrides this behavior, and using now() sets the column to machine time, not UTC time. (There is a function I defined, utc_now(), which will return UTC time, but you don't need to use it in this case.)

Technically this is a bug, since now() provides local instead of UTC datetime values. However, I am not of any errors this will cause.

This is low priority and a comprehensive update can wait until we transition to dplyr (#395).

rykelly pushed a commit to rykelly/pecan that referenced this issue Oct 28, 2016
This was causing bugs for me when running multiple workflows at once (not too hard to get two with the same "now" timestamp), and it also addresses PecanProject#1083
@github-actions
Copy link

This issue is stale because it has been open 365 days with no activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants