# Setting up psql, the PostgreSQL CLI

DevFeed: [Setting up psql, the PostgreSQL CLI](<https://devfeed.tech/articles/setting-up-psql-the-postgresql-cli-34576.md>)

Original publisher: [Read original article](<https://tapoueh.org/blog/2017/12/setting-up-psql-the-postgresql-cli/>)

Author: Dimitri Fontaine PostgreSQL Major Contributor; Author

Published: 2017-12-22T14:23:43Z

Content type: tutorial

Language: en

Sources: [Dimitri Fontaine](<https://devfeed.tech/sources/dimitri-fontaine.md>)

Topics: [PostgreSQL](<https://devfeed.tech/topics/postgresql.md>), [Command-line interface](<https://devfeed.tech/topics/cli.md>), [console](<https://devfeed.tech/topics/console.md>), [Scripting](<https://devfeed.tech/topics/scripting.md>), [SQL](<https://devfeed.tech/topics/sql.md>), [Environment Variables](<https://devfeed.tech/topics/environment-variables.md>)

Tags: [cli](<https://devfeed.tech/tags/cli.md>), [console](<https://devfeed.tech/tags/console.md>), [environment-variables](<https://devfeed.tech/tags/environment-variables.md>), [history](<https://devfeed.tech/tags/history.md>), [input](<https://devfeed.tech/tags/input.md>), [interactive](<https://devfeed.tech/tags/interactive.md>), [keyboard](<https://devfeed.tech/tags/keyboard.md>), [less](<https://devfeed.tech/tags/less.md>), [pager](<https://devfeed.tech/tags/pager.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>), [psql](<https://devfeed.tech/tags/psql.md>), [redirection](<https://devfeed.tech/tags/redirection.md>), [repl](<https://devfeed.tech/tags/repl.md>), [scripting](<https://devfeed.tech/tags/scripting.md>), [setup](<https://devfeed.tech/tags/setup.md>)

## AI overview

A tutorial on setting up and using psql, PostgreSQL's command-line console. It explains interactive and scripting features, the REPL workflow, and configuration through the psqlrc file and environment variables.

## Source excerpt

PostgreSQL ships with an interactive console with the command line tool named psql. It can be used both for scripting and interactive usage and is moreover quite a powerful tool. Interactive features includes autocompletion, readline support (history searches, modern keyboard movements, etc), input and output redirection, formatted output, and more.