lib / pq

Pure Go Postgres driver for database/sql
https://pkg.go.dev/github.com/lib/pq
MIT License
8.89k stars 906 forks source link

EnableInfinityTs() panics if called twice, requiring a NOP recover() #1029

Open bartgrantham opened 3 years ago

bartgrantham commented 3 years ago

EnableInfinityTs() panics if called twice, but there is no way for client code to check if it's already been called (ex. in init code in a separate library). At the very least exporting infinityTsEnabled would allow users to check if it's been called. It's messy to have to do a NOP recover().

A better solution would be a function that would allow users to both check if infinity timestamps have been enabled and what they have been set to.