Postgresql - Dump
1 | Dump all without Repmgr (nexus): |
Postgresql - Retrait Tables
1 | sudo sed -i -e '/public.batch_/d' -e '/public.download_count/d' /pgsql_backup/nexus_data_transfert/db_nexus.dump |
Postgresql - Update Tables
1 | sudo -u postgres /usr/pgsql-16/bin/psql -tAc "update repository set attributes = replace(attributes::TEXT,': 18444.0',': 8081.0')::jsonb where name='docker-private';" nexus |
Postgresql - Restore Dump with Errors Catch
1 | sudo -i -u postgres psql -d nexus -f /bind_pg_backup/nexus_data_transfert/db_nexus.dump 2>log_errors.txt |
Postgresql - Drop with Force
1 | sudo -i -u postgres psql -tAc "DROP DATABASE IF EXISTS nexus WITH (FORCE);" |
Postgresql - Reset Admin Password
1 | sudo -u postgres /usr/pgsql-16/bin/psql nexus |
Import propre sql
1 | mysql -u root -e "source /db.sql;" |
Repmgr Cluster
En Vrac:
1 | sudo -u postgres /usr/pgsql-16/bin/repmgr -f /etc/repmgr/16/repmgr.conf cluster show |
Repmgr Simple Sync
1 | sudo systemctl stop postgresql-16 |
Repmgr Hard Sync
1 | sudo systemctl start postgresql-16 |