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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.