psql Command Basics
Source: raw/postgres/psql commands.md.
Service control
sudo service postgresql status
sudo systemctl reload postgresqlConnecting
psql -U postgres # default admin user
psql -U username -d database_name # specific user + db
psql -U username -d database_name -h host -p port # full connectionCreate a database
createdb dbname;Open questions
- Common psql meta-commands (
\l,\dt,\d,\c,\?). - Auth: peer vs md5 vs scram-sha-256;
pg_hba.conf. - How this relates to Cloudflare Hyperdrive connection strings.