hasura / hasura/graphql-engine
Cannot Use Postgres CURRENT_TIMESTAMP for Column Default
- Dominant language
- TypeScript
- Stars
- 32.1k
- Forks
- 3k
- PR merge metrics
- PR metrics pending
Description
# About
When trying to use `CURRENT_TIMESTAMP` as a column default, the Hasura Console errored out. This is a valid function in PG so not sure why it is blocked. I've used `clock_timestamp()` to work around.
https://www.postgresqltutorial.com/postgresql-current_timestamp/
## Steps To Reproduce
* Go to any table with a timestamp with timezone data type (e.g. updated_at or created_at)
* Edit and enter `CURRENT_TIMESTAMP` for default
* Hit Save
## Expected Behavior
Change to be saved
## Actual Behavior

Contributor guide
Research direction
Reproduce the failure in the Hasura Console using a timestamp-with-timezone column and CURRENT_TIMESTAMP as the default. Trace the Console's handling of the column default, then verify that CURRENT_TIMESTAMP is accepted and the change can be saved without affecting the existing clock_timestamp() workaround.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- postgresql, typescript
- Domain
- database, frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100