User Tools

Site Tools


сервис_postgresql

Сервис PostgreSQL

psql

$ sudo -u postgres psql

postgres=# \l

postgres=# \c blogs

blogs=# \dt

blogs=# \d table_name

postgres=# ALTER USER postgres WITH PASSWORD 'strongpassword';

Подключение по сети

# diff postgresql.conf /etc/postgresql/15/main/postgresql.conf
59a60
> listen_addresses = '*'

# diff pg_hba.conf /etc/postgresql/15/main/pg_hba.conf
97c97,98
< host    all             all             127.0.0.1/32            scram-sha-256
---
> #host    all             all             127.0.0.1/32            scram-sha-256
> host    all             all             0.0.0.0/0            scram-sha-256

# systemctl restart postgresql

$ psql postgres://postgres:strongpassword@IP_OR_DNS_NAME:5432/postgres
сервис_postgresql.txt · Last modified: 2025/04/07 16:12 by val