PostgreSQL: Difference between revisions

From David's Wiki
(Created page with "==Users== <syntaxhighlight lang="postgres"> CREATE USER myuser WITH ENCRYPTED PASSWORD 'mypass'; ALTER USER david WITH SUPERUSER; </syntaxhighlight>")
 
No edit summary
Line 1: Line 1:
==Installation==
===Upgrading===
See [https://stackoverflow.com/questions/60409585/how-to-upgrade-postgresql-database-from-10-to-12-without-losing-data-for-openpro]
# Backup old postgres cluster
#: <pre>sudo su postgres</pre>
#: <pre>psql_dumpall > export.sql</pre>
# Install new postgresql version
#: <pre>sudo apt install postgresql-13</pre>
# Migrate database and configuration files
##
# Remove and cleanup old postgresql files
##
==Users==
==Users==
<syntaxhighlight lang="postgres">
<syntaxhighlight lang="postgres">

Revision as of 15:25, 11 January 2021

Installation

Upgrading

See [1]

  1. Backup old postgres cluster
    sudo su postgres
    psql_dumpall > export.sql
  2. Install new postgresql version
    sudo apt install postgresql-13
  3. Migrate database and configuration files
  4. Remove and cleanup old postgresql files

Users

CREATE USER myuser WITH ENCRYPTED PASSWORD 'mypass';
ALTER USER david WITH SUPERUSER;