= Psql = The '''`psql(1)`''' utility is a simple, terminal-based client for PostgreSQL databases. <> ---- == Installation == `psql(1)` is not typically packaged with the core components. For [[Linux/Arch|Arch]], install the `postgresql-libs` package. For [[Linux/Alpine|Alpine]] or [[Linux/Debian|Debian]], install the `postgresql-client` package. ---- == Usage == To open a REPL with a local PostgreSQL database, try: {{{ psql --username=postgres }}} Aside from SQL queries, there are special commands available in the REPL. === Commands === ||'''Command''' ||'''Meaning''' || ||`\c [DATABASE]`||Connect to `[DATABASE]` || ||`\d` ||List tables and relations|| ||`\dt` ||List all tables || ||`\di` ||List all indices || ---- CategoryRicottone