graphql-engine/server
Antoine Leblanc 697137dd77 Fix Postgres not padding timestamps correctly (fix hasura/graphql-engine#8096)
## Description

As identified in hasura/graphql-engine#8096, the format string we used for timestamps was incorrect; we were using `%F`, which expands to `%Y-%m-%d`; but that meant that the year was not padded to four digits: `0001` would be represented simply as `1`. However, Postgres inteprets that `1` as `2001`, probably due to interpretation rules about two-digit years (in `25/12/01`, `01` is indeed `2001`).

```
# create table timestamp_test ( test timestamptz );
CREATE TABLE
# insert into timestamp_test values ('1-01-01T00:00:57Z');
INSERT 0 1
# select * from timestamp_test;
          test
------------------------
 2001-01-01 00:00:57+00
(1 row)
```

To fix this, this PR changes the format string to use `%0Y`, which always pads the year number with zeroes.

## Remaining work

- [x] write Changelog entry
- [ ] copy timestamp tests from the python suite into the hspec tests

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3536
GitOrigin-RevId: fa144111358339fd4a35b32d888c1d2c5b418ea6
2022-05-09 12:18:18 +00:00
..
bench-wrk server, pro: actually reformat the code-base using ormolu 2021-09-23 22:57:37 +00:00
benchmarks ci: hide old benchmark reports for PRs with many comments 2022-02-24 20:09:17 +00:00
documentation server/tests: unify HASURA_BIGQUERY_SERVICE_KEY and HASURA_BIGQUERY_SERVICE_ACCOUNT env vars 2022-03-14 07:50:35 +00:00
packaging ci: use pg_dump from postgres 14 2022-04-18 06:25:02 +00:00
src-dc-api Data Connector Agent Configuration Schema [GDW-103] 2022-05-05 05:19:46 +00:00
src-exec Remove RQL/Types.hs 2022-04-27 13:58:47 +00:00
src-lib Fix Postgres not padding timestamps correctly (fix hasura/graphql-engine#8096) 2022-05-09 12:18:18 +00:00
src-rsr ci: tag release v2.5.2 and v2.6.1 2022-05-03 09:36:04 +00:00
src-test Data Connector Agent Configuration Schema [GDW-103] 2022-05-05 05:19:46 +00:00
tests-dc-api Data Connector Agent Configuration Schema [GDW-103] 2022-05-05 05:19:46 +00:00
tests-hspec Fix Postgres not padding timestamps correctly (fix hasura/graphql-engine#8096) 2022-05-09 12:18:18 +00:00
tests-py server/docs: Add/update BigQuery test setup info 2022-05-04 07:37:22 +00:00
.dockerignore update packages (#251) 2018-08-08 13:10:13 +05:30
.gitignore server: Clean up Cabal project files 2022-04-07 07:16:12 +00:00
commit_diff.txt Rewrite GraphQL schema generation and query parsing (close #2801) (#4111) 2020-08-21 12:27:01 -05:00
COMPILING-ON-MACOS.md Improve COMPILING-ON-MACOS.md 2022-05-09 08:32:56 +00:00
CONTRIBUTING.md server/tests: Troubleshooting docs 2022-05-04 08:23:53 +00:00
graphql-engine.cabal Fix Postgres not padding timestamps correctly (fix hasura/graphql-engine#8096) 2022-05-09 12:18:18 +00:00
Makefile ci: misc. cleanup, naming 2022-01-03 06:26:39 +00:00
STYLE.md server, CI: use ormolu as a formatter for Haskell sources 2021-09-23 21:23:21 +00:00
testing-guidelines.md server: testing guidelines 2022-03-08 09:53:27 +00:00