Postgres: Difference between revisions
| Line 6: | Line 6: | ||
\dt // show tables | \dt // show tables | ||
<SQL>; | <SQL>; | ||
CREATE DATABASE <DB>; // !!! case sensitive and semicolon | |||
dropdb -h <HOSTNAME> -U <User> <DB> | dropdb -h <HOSTNAME> -U <User> <DB> | ||
createdb -h <HOSTNAME> -U <User> <DB> | createdb -h <HOSTNAME> -U <User> <DB> | ||
Revision as of 07:14, 17 September 2021
Operation
psql -h <HOSTNAME> -U <USER> [<DB>] psql <DB> <USER> \l // show databases \c <DB> // connect to DB \dt // show tables <SQL>; CREATE DATABASE <DB>; // !!! case sensitive and semicolon dropdb -h <HOSTNAME> -U <User> <DB> createdb -h <HOSTNAME> -U <User> <DB>