Ubuntu/postgres
From r00tedvw.com wiki
(Difference between revisions)
(Created page with "==Login as root== <nowiki>~$ sudo su - postgres ~$ psql postgres=#</nowiki> ==List databases== ====List all DBs==== <nowiki>postgres=# \list -OR- \l</nowiki> ====List all t...") |
|||
Line 9: | Line 9: | ||
====List all tables in current DB==== | ====List all tables in current DB==== | ||
<nowiki>postgres=# \dt </nowiki> | <nowiki>postgres=# \dt </nowiki> | ||
+ | |||
+ | ==Connect to DB== | ||
+ | <nowiki>postgres=# \connect <database name></nowiki> |
Latest revision as of 14:58, 5 June 2015
Contents |
[edit] Login as root
~$ sudo su - postgres ~$ psql postgres=#
[edit] List databases
[edit] List all DBs
postgres=# \list -OR- \l
[edit] List all tables in current DB
postgres=# \dt
[edit] Connect to DB
postgres=# \connect <database name>