Skip to content

Commit 46c9958

Browse files
authored
Merge pull request #622 from fredericve/pg_read_all_settings
Add pg_read_all_settings grant for homer role so database can be rotated
2 parents c3e1417 + e55caf7 commit 46c9958

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

migration/migration.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,10 @@ func CreateHomerRole(dataRootDBSession *gorm.DB, dataHomeDBSession *gorm.DB, use
106106
sql = fmt.Sprintf("GRANT ALL PRIVILEGES ON DATABASE %s to %s;", homeDBDataQuoted, userQuoted)
107107
dataRootDBSession.Debug().Exec(sql)
108108

109+
// To permit examining data_directory for rotation
110+
sql = fmt.Sprintf("GRANT pg_read_all_settings TO %s;", userQuoted)
111+
dataRootDBSession.Debug().Exec(sql)
112+
109113
sql = fmt.Sprintf("ALTER DATABASE %s OWNER TO %s;", homeDBConfigQuoted, userQuoted)
110114
dataRootDBSession.Debug().Exec(sql)
111115

0 commit comments

Comments
 (0)