GetPostgresDataPath returns the path where PostgreSQL actually stores data files This differs from GetPostgresDataDir for PostgreSQL 18+ where files are in a version-specific subdirectory
()
| 163 | // GetPostgresDataPath returns the path where PostgreSQL actually stores data files |
| 164 | // This differs from GetPostgresDataDir for PostgreSQL 18+ where files are in a version-specific subdirectory |
| 165 | func (app *DdevApp) GetPostgresDataPath() string { |
| 166 | if app.Database.Type != nodeps.Postgres { |
| 167 | return "" |
| 168 | } |
| 169 | |
| 170 | if slices.Contains([]string{nodeps.Postgres9, nodeps.Postgres10, nodeps.Postgres11, nodeps.Postgres12, nodeps.Postgres13, nodeps.Postgres14, nodeps.Postgres15, nodeps.Postgres16, nodeps.Postgres17}, app.Database.Version) { |
| 171 | return "/var/lib/postgresql/data" |
| 172 | } |
| 173 | |
| 174 | // Postgres 18+ stores actual data files in version-specific subdirectory |
| 175 | // See https://github.com/docker-library/postgres/pull/1259 |
| 176 | return "/var/lib/postgresql/" + app.Database.Version + "/docker" |
| 177 | } |
no outgoing calls