O'Reilly logo

PostgreSQL for Data Architects by Jayadevan Maymala

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required