PostgreSQL on HomeBrew
Путь по которому лежат конфигурационные файлы и сами данные: /usr/local/var/postgresql@16
Обновление Postgres
- Остановить БД:
brew services stop postgresql@15
- Проверка перед переносом данных:
/usr/local/opt/postgresql@16/bin/pg_upgrade --old-datadir=/usr/local/var/postgresql@15 --new-datadir=/usr/local/var/postgresql@16 --old-bindir=/usr/local/opt/postgresql@15/bin --new-bindir=/usr/local/opt/postgresql@16/bin --old-options='-c config_file=/usr/local/var/postgresql@15/postgresql.conf' --new-options='-c config_file=/usr/local/var/postgresql@16/postgresql.conf' --check
Проведение проверок целостности
-------------------------------
Checking cluster versions ок
Checking database user is the install user ок
Checking database connection settings ок
Checking for prepared transactions ок
Checking for system-defined composite types in user tables ок
Checking for reg* data types in user tables ок
Checking for contrib/isn with bigint-passing mismatch ок
Checking for incompatible "aclitem" data type in user tables ок
Checking for presence of required libraries ок
Checking database user is the install user ок
Checking for prepared transactions ок
Checking for new cluster tablespace directories ок
*Кластеры совместимы*
- То же самое но без
--check
на конце мигрирует данные. brew services start postgresql@16
/usr/local/opt/postgresql@16/bin/vacuumdb --all --analyze-in-stages
brew uninstall postgresql@15
Source:: https://www.kostolansky.sk/posts/upgrading-to-postgresql-15/