SPOJE.NET

Technická dokumentace

Uživatelské nástroje

Nástroje pro tento web


Postranní lišta


Provozují SPOJE.NET.
Nejlepší internet v Praze.

howto:hosting:pgsql_instalace

PostgreSQL (Instalace, konfigurace)

Prikazy

  • Vstup do konzole (na Debianu?)
    • su - postgres
    • psql
  • Vytvoreni spravcovskeho uctu
    • CREATE USER jmeno WITH SUPERUSER ENCRYPTED PASSWORD 'heslo';

Zalohovani

Spousteno cronem pod uzivatelem postgres

  • pg_dumpall -f jmeno_souboru.sql - provede dump celeho clusteru, tj. vsech databazi vcetne roli a schemat
  • pg_dump davical -f jmeno_souboru.sql - provede dump pouze obsahu zvolene databaze

Upgrade

Popisujeme upgrade z verze 9.1 na 9.4

su postgres
pg_dropcluster --stop 9.4 main  #zatavime defaultne nainstalovany cluster
pg_upgradecluster -v 9.4 9.1 main   #pg_upgradecluster -v NEW OLD main
...
Fixing hardcoded library paths for stored procedures...
Upgrading database czfmapa...
Analyzing database czfmapa...
Fixing hardcoded library paths for stored procedures...
Upgrading database template1...
Analyzing database template1...
Fixing hardcoded library paths for stored procedures...
Upgrading database hosts...
Analyzing database hosts...
Fixing hardcoded library paths for stored procedures...
Upgrading database nagios...
Analyzing database nagios...
Fixing hardcoded library paths for stored procedures...
Upgrading database postgres...
Analyzing database postgres...
Fixing hardcoded library paths for stored procedures...
Upgrading database davical...
Analyzing database davical...
Re-enabling connections to the old cluster...
Re-enabling connections to the new cluster...
Copying old configuration files...
Copying old start.conf...
Copying old pg_ctl.conf...
Copying old server.crt...
Copying old server.key...
Stopping target cluster...
Stopping old cluster...
Disabling automatic startup of old cluster...
Configuring old cluster to use a different port (5433)...
Starting target cluster on the original port...
Success. Please check that the upgraded cluster works. If it does,
you can remove the old cluster with pg_dropcluster 9.1 main

postgres@dev:~$ psql 
psql (9.4.24)
Type "help" for help.
howto/hosting/pgsql_instalace.txt · Poslední úprava: 2019/12/06 12:24 autor: gandalf