PostgreSQL: Difference between revisions
No edit summary |
(→Users) |
||
Line 23: | Line 23: | ||
==Users== | ==Users== | ||
<syntaxhighlight lang="postgres"> | <syntaxhighlight lang="postgres"> | ||
/* Create user */ | |||
CREATE USER myuser WITH ENCRYPTED PASSWORD 'mypass'; | CREATE USER myuser WITH ENCRYPTED PASSWORD 'mypass'; | ||
/* Give superuser */ | |||
ALTER USER myuser WITH SUPERUSER; | ALTER USER myuser WITH SUPERUSER; | ||
</syntaxhighlight> | </syntaxhighlight> |
Latest revision as of 21:38, 5 April 2021
Getting Started
Installation
Upgrading
See [1]
- Backup old postgres cluster
sudo su postgres
psql_dumpall > export.sql
- Install new postgresql version
sudo apt install postgresql-13
- Migrate database and configuration files
- Remove and cleanup old postgresql files
Defaults
To get into postgres for the first time:
sudo -u postgres psql postgres
Users
/* Create user */
CREATE USER myuser WITH ENCRYPTED PASSWORD 'mypass';
/* Give superuser */
ALTER USER myuser WITH SUPERUSER;