Просмотр исходного кода

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.
Anshul Gupta 1 год назад
Родитель
Сommit
3a966c6ce5
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      internal/storage/timezone.go

+ 1 - 1
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)
 	}