Skip to content

Commit 7b67b17

Browse files
committed
Fix time zone regexp
1 parent 8017304 commit 7b67b17

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

postgres.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ func (dialector Dialector) Initialize(db *gorm.DB) (err error) {
6161
if dialector.Config.PreferSimpleProtocol {
6262
config.PreferSimpleProtocol = true
6363
}
64-
result := regexp.MustCompile("(time_zone|TimeZone)=(.*)($|&| )").FindStringSubmatch(dialector.Config.DSN)
64+
result := regexp.MustCompile("(time_zone|TimeZone)=(.*?)($|&| )").FindStringSubmatch(dialector.Config.DSN)
6565
if len(result) > 2 {
6666
config.RuntimeParams["timezone"] = result[2]
6767
}

0 commit comments

Comments
 (0)