Postgres

From Wiki RB4
Revision as of 12:49, 17 September 2021 by UweHeuer (talk | contribs) (→‎Operation)

Operation

psql -h <HOSTNAME> -U <USER> [<DB>]
psql <DB> <USER>
  \l // show databases
  \c <DB> // connect to DB

\d

// show schema of table \dt // show tables <SQL>; CREATE DATABASE <DB>; // !!! case sensitive and semicolon dropdb -h <HOSTNAME> -U <User> <DB> createdb -h <HOSTNAME> -U <User> <DB>