From 3a966c6ce5664a3b78f83120529e2662bba7484a Mon Sep 17 00:00:00 2001 From: Anshul Gupta Date: Mon, 18 Nov 2024 16:04:05 -0800 Subject: [PATCH] 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. --- internal/storage/timezone.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/storage/timezone.go b/internal/storage/timezone.go index 263dae1e..f3748735 100644 --- a/internal/storage/timezone.go +++ b/internal/storage/timezone.go @@ -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) }