690 shaares
3 liens privés
3 liens privés
Pense-bête
psql -p 5555 -h 10.0.10.2 -U <user> -d <database
Create user
create database mydb;
create user myuser with encrypted password 'mypass';
grant all privileges on database mydb to myuser;
List databases
\list or \l : list all databases
\c dbname or connect dbname : connect to database
\dt : list all tables in the current database
\d+ <table> : describe table
Size of database
SELECT pg_size_pretty(pg_database_size('db'));