Basic PostgreSQL Commands


Connect

$ psql -h [hostname] -p [port]
# Default port: 543

Example

$ psql -h localhost

Create DB

$ CREATE DATABASE [database_name];

Delete DB

$ DROP DATABASE [database_name];

Disconnect

$ \q
comments powered by Disqus