psql – working from the command line

psql is a very powerful command-line tool and is superior to similar utilities available with other databases. For example, if we are not sure about the name of a table (did I name it emp, employee, or employees?), the only option available in Oracle's SQL* Plus is to query a data dictionary view (such as user_tables or tab) with a LIKE filter. In psql, we can just type \dt e and hit Tab twice to get the list of tables starting with e. In short, psql supports tab completion—a nifty feature that is a great productivity booster. Now that it sounds interesting, let's look at more.

psql – connection options

The psql --help command lists all possible options that can be used with psql. We might want to use psql to ...

Get PostgreSQL for Data Architects now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.