Skip to content

Commit

Permalink
Merge branch 'main' into current-lsn-fetch-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
heavycrystal authored Dec 19, 2024
2 parents cf83886 + c0e5fba commit 7f24fa8
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions flow/connectors/postgres/qvalue_convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -584,18 +584,18 @@ func customTypeToQKind(typeName string) qvalue.QValueKind {
// in tstzrange.
// convertTimeRangeBound removes the +0000 UTC part
func convertTimeRangeBound(timeBound interface{}) (string, error) {
if timeBound, isInfinite := timeBound.(pgtype.InfinityModifier); isInfinite {
return timeBound.String(), nil
}

layout := "2006-01-02 15:04:05 -0700 MST"
postgresFormat := "2006-01-02 15:04:05"
var convertedTime string
if timeBound != nil {
lowerParsed, err := time.Parse(layout, fmt.Sprint(timeBound))
if err != nil {
return "", fmt.Errorf("unexpected lower bound value in tstzrange. Error: %v", err)
return "", fmt.Errorf("unexpected bound value in tstzrange. Error: %v", err)
}
convertedTime = lowerParsed.Format(postgresFormat)
} else {
convertedTime = ""
return lowerParsed.Format(postgresFormat), nil
}

return convertedTime, nil
return "", nil
}

0 comments on commit 7f24fa8

Please sign in to comment.