Update postgresql_type.go: accept "timestamp" as a case (#3811)
Some checks failed
kotlin / test (push) Has been cancelled
python / test (push) Has been cancelled
typescript / test (push) Has been cancelled
go / test macos-14 cgo=0 (push) Has been cancelled
go / test ubuntu-22.04 cgo=0 (push) Has been cancelled
go / test macos-14 cgo=1 (push) Has been cancelled
go / test ubuntu-22.04 cgo=1 (push) Has been cancelled
go / vuln_check (push) Has been cancelled

the only type accepted as a case for postgres type `timestamp` is `pg_catalog.timestamp`. It would be better if `timestamp` was also accepted directly, just as `timestamptz` is.
This commit is contained in:
Anurag Mishra 2025-02-10 09:34:26 +05:30 committed by GitHub
parent 4c4408479d
commit ec9d492c40
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -233,7 +233,7 @@ func postgresType(req *plugin.GenerateRequest, options *opts.Options, col *plugi
}
return "sql.NullTime"
case "pg_catalog.timestamp":
case "pg_catalog.timestamp", "timestamp":
if driver == opts.SQLDriverPGXV5 {
return "pgtype.Timestamp"
}