1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-16 18:01:37 +00:00

fix: replace timezone function call with view

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.
This commit is contained in:
Anshul Gupta 2024-11-18 16:04:05 -08:00 committed by Frédéric Guillot
parent b2e702218d
commit 3a966c6ce5

View file

@ -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)
}