diff --git a/IT/SQL/PostgreSQL/Upgrade.md b/IT/SQL/PostgreSQL/Upgrade.md index ad5667d..5b65bfa 100644 --- a/IT/SQL/PostgreSQL/Upgrade.md +++ b/IT/SQL/PostgreSQL/Upgrade.md @@ -26,6 +26,14 @@ sudo -iu postgres cd /var/lib/postgres/tmp ``` +- init new db + +```bash +initdb -D /var/lib/postgres/data --locale=C.UTF-8 --encoding=UTF8 --data-checksums +``` + +- if use extention copy extention file from /usr/lib/postgresql/ to /opt/pgsql-PG_VERSION/lib + - launch upgrade ```bash @@ -35,6 +43,12 @@ pg_upgrade -b /opt/pgsql-PG_VERSION/bin -B /usr/bin -d /var/lib/postgres/olddata - check both pg_hba.conf in new and old cluster - restart server `sc-start postgresql` +if need to restart old database + +```bash +/opt/pgsql-16/bin/pg_ctl -w -D "/var/lib/postgres/olddata" -o "-p 50432 -b -c listen_addresses='' -c unix_socket_permissions=0700 -c unix_socket_directories='/var/lib/postgres/tmp'" stop +``` + ## sequece manipulation sequence are use to generate uniq identifier