Skip to content

Commit

Permalink
fix: replace timezone function call with view
Browse files Browse the repository at this point in the history
The `pg_timezone_names` view was added in 8.2.
It should be equivalent to the function query.
See: https://pgpedia.info/p/pg_timezone_names.html

This small change allows `miniflux` to run on postgres-compatible
databases like CockroachDB, which don't have this function.
  • Loading branch information
ansg191 committed Nov 19, 2024
1 parent c6c71c5 commit 1e325c0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/storage/timezone.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
// Timezones returns all timezones supported by the database.
func (s *Storage) Timezones() (map[string]string, error) {
timezones := make(map[string]string)
rows, err := s.db.Query(`SELECT name FROM pg_timezone_names() ORDER BY name ASC`)
rows, err := s.db.Query(`SELECT name FROM pg_timezone_names ORDER BY name ASC`)
if err != nil {
return nil, fmt.Errorf(`store: unable to fetch timezones: %v`, err)
}
Expand Down

0 comments on commit 1e325c0

Please sign in to comment.