Skip to content

Commit

Permalink
Cover PGSQL date format edgecase for '%dT%H
Browse files Browse the repository at this point in the history
This format combination produces an invalid output; the T needs
to be escaped.
This "trick" will do for now.
  • Loading branch information
tjerman committed May 10, 2022
1 parent e7d3df1 commit 07c409e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions store/postgres/sql_functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ func sqlFunctionHandler(f ql.Function) (ql.ASTNode, error) {

func translateDateFormatParams(format string) string {
return strings.NewReplacer(
// @todo Doing ...%dT%H... (for iso tomestamp) pgsql doesn't format it correctly
// so I'm covering this edgecase.
// We should fix this properly when we redo record storage.
`%dT%H`, `DD"T"HH24`,

`%a`, `Dy`,
`%b`, `Mon`,
`%c`, `FMMM`,
Expand Down

0 comments on commit 07c409e

Please sign in to comment.