Tags

Login to postgresql
# psql -U postgres

Show all databases
postgres=# \l

Create a new database
postgres=# CREATE DATABASE postgresdb;

Connect to database
postgres=# \connect {DATABASENAME}

Show all tables
postgres=# \dt

Describe a table
postgres=# \d {TABLENAME}

postgres-# \connect {DATABASENAME}
postgres-# GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO bob;

Advertisements