Skip to content

Commit

Permalink
add possible postgresql.conf location on M1 Mac
Browse files Browse the repository at this point in the history
Homebrew has deprecated the "postgresql" formula in favor of
the more explicit "postgresql@XX" formulae. This commit tells
timescaledb_tune to additionally check for postgresql.conf in those
places.
  • Loading branch information
rtwalker committed Oct 4, 2022
1 parent 7ffd069 commit 9d2f3db
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/tstune/config_file.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const (
fileNameMac = "/usr/local/var/postgres/postgresql.conf"
fileNameMacFmt = "/usr/local/var/postgresql@%s/postgresql.conf"
fileNameMacM1 = "/opt/homebrew/var/postgres/postgresql.conf"
fileNameMacM1Fmt = "/opt/homebrew/var/postgresql@%s/postgresql.conf"
fileNameDebianFmt = "/etc/postgresql/%s/main/postgresql.conf"
fileNameRPMFmt = "/var/lib/pgsql/%s/data/postgresql.conf"
fileNameArch = "/var/lib/postgres/data/postgresql.conf"
Expand Down Expand Up @@ -64,6 +65,10 @@ func getConfigFilePath(system, pgVersion string) (string, error) {
if fileName != "" {
return fileName, nil
}
fileName = try(fileNameMacM1Fmt, pgVersion)
if fileName != "" {
return fileName, nil
}
case osLinux:
fileName := try(fileNameDebianFmt, pgVersion)
if fileName != "" {
Expand Down

0 comments on commit 9d2f3db

Please sign in to comment.