PostgreSQL » History » Version 1
Willy Manga, 06/10/2026 01:30 PM
| 1 | 1 | Willy Manga | h1. PostgreSQL |
|---|---|---|---|
| 2 | |||
| 3 | little setup from "netbox":https://netboxlabs.com/docs/netbox/installation/postgresql/ |
||
| 4 | |||
| 5 | <pre><code class="sql"> |
||
| 6 | root@netbox:~# sudo -u postgres psql |
||
| 7 | psql (17.10 (Debian 17.10-0+deb13u1)) |
||
| 8 | Type "help" for help. |
||
| 9 | |||
| 10 | postgres=# create database netbox; |
||
| 11 | CREATE DATABASE |
||
| 12 | postgres=# create user doops with password 'cocolided' ; |
||
| 13 | CREATE ROLE |
||
| 14 | postgres=# alter database netbox owner to netbox; |
||
| 15 | ERROR: role "netbox" does not exist |
||
| 16 | postgres=# alter database netbox owner to doops; |
||
| 17 | ALTER DATABASE |
||
| 18 | postgres=# \connect netbox |
||
| 19 | You are now connected to database "netbox" as user "postgres". |
||
| 20 | netbox=# grant create on schema public to doops; |
||
| 21 | GRANT |
||
| 22 | netbox=# \l |
||
| 23 | List of databases |
||
| 24 | Name | Owner | Encoding | Locale Provider | Collate | Ctype | Locale | ICU Rules | Access privileges |
||
| 25 | -----------+----------+----------+-----------------+-------------+-------------+--------+-----------+----------------------- |
||
| 26 | netbox | doops | UTF8 | libc | en_US.UTF-8 | en_US.UTF-8 | | | |
||
| 27 | postgres | postgres | UTF8 | libc | en_US.UTF-8 | en_US.UTF-8 | | | |
||
| 28 | template0 | postgres | UTF8 | libc | en_US.UTF-8 | en_US.UTF-8 | | | =c/postgres + |
||
| 29 | | | | | | | | | postgres=CTc/postgres |
||
| 30 | template1 | postgres | UTF8 | libc | en_US.UTF-8 | en_US.UTF-8 | | | =c/postgres + |
||
| 31 | | | | | | | | | postgres=CTc/postgres |
||
| 32 | (4 rows) |
||
| 33 | |||
| 34 | </code></pre> |