PGCLI(1)
π PGCLI β like, the manual, but make it make sense
okay bestie, sit down, hydrate, because we're talking about pgcli β the Postgres client that actually gets you. β¨ This is the manual page for pgcli version 4.7.1, and I'm gonna walk you through every single flag like we're texting at 2am. No skips. No "you'll figure it out." We're doing this properly. π«Ά
β¨ NAME β¨
pgcli β the manual page for pgcli 4.7.1. That's it, that's the name, iconic behavior honestly. π
πΈ SYNOPSIS πΈ
pgcli [OPTIONS] [DBNAME] [USERNAME]
so you got your OPTIONS, you got an optional DBNAME, you got an optional USERNAME β and you're off to the races, babe. π
π OPTIONS π
Every single one, in order, no cap. Read them all, they're literally all useful.
-h,--host TEXTβ the host address of the postgres database. where is she? tell me where she lives. π-p,--port INTEGERβ the port number at which the postgres instance is listening. it's giving "I'm on this port and I'm not moving." π-U,--username TEXTβ the username to connect to the postgres database.-u,--user TEXTβ the username to connect to the postgres database. yes bestie, it's the same thing as-U, two spellings, one vibe. π--timeout INTEGERβ how many seconds to wait for a connection before giving up. and listen:0waits forever, which is a choice. This one overrides both the connection string and$PGCONNECT_TIMEOUT. she said "I don't care what they told you, I'm in charge." π€-W,--passwordβ force the password prompt. you will be asked. no escape. π-w,--no-passwordβ never prompt for a password. the opposite energy. also no escape, just in the other direction. π--single-connectionβ do not use a separate connection for completions. one connection, one queen, no side pieces. π-v,--versionβ the version ofpgcli. show me your ID. πͺͺ-d,--dbname TEXTβ the database name to connect to. which one are we pulling up. π--pgclirc FILEβ the location of thepgclircfile. your config, your rules. β¨-D,--dsn TEXTβ use a DSN configured in the[alias_dsn]section of thepgclircfile. cute little nickname for your connection. π¦--list-dsnβ shows the list of DSNs configured in the[alias_dsn]section of thepgclircfile. a little roster. π--row-limit INTEGERβ set the threshold for the row limit prompt. use0to disable the prompt entirely. (yes, zero = off, noted, don't forget.) π--application-name TEXTβ the application name for the connection.--less-chattyβ skip the intro on startup and the goodbye on exit. for when you're in your mysterious, no-small-talk era. π§-t,--tuples-onlyβ print rows only: no column headers, no status footer, and no timing, just likepsql. strictly business. π₯--prompt TEXTβ the prompt format. Default:"\u@\h:\d> ".--prompt-dsn TEXTβ the prompt format for connections using DSN aliases. Default:"\u@\h:\d> ". (same default, different situation, she's flexible.) π-l,--listβ list the available databases, then exit. window shopping, basically. ποΈ--pingβ check database connectivity, then exit. u up? πΆ--auto-vertical-outputβ automatically switch to vertical output mode if the result is wider than the terminal width. she adapts. π--warn TEXTβ warn before running a destructive query. a little "bestie are you SURE" moment. β οΈ--ssh-tunnel TEXTβ open an SSH tunnel to the given address and connect to the database from it. sneaky, secure, slay. π--log-file TEXTβ write all queries & output into a file, in addition to the normal output destination. receipts, always. π§Ύ--init-command TEXTβ an SQL statement to execute after connecting. a lil opening act. π¬-c,--command TEXTβ run a command (SQL or internal) and exit. multiple-coptions are allowed, so stack 'em up, queen. π₯-y,--yesβ force destructive commands without the confirmation prompt. bold. fearless. possibly chaotic. you've been warned. π-f,--file FILEβ execute commands from a file, then exit. multiple-foptions are allowed, yes you can pile those on too. π--helpβ show this message and exit. hi, hello, welcome, here's everything, bye. π
π reminder: every flag above does exactly what it says and nothing more. I'm not out here inventing behavior for you, bestie. that's the whole point.
π a lil sign-off π
this page is from pgcli 4.7.1, dated September 2026. mwah. go connect to something. πβ¨π¦
π¦ where this page comes from
- fedora 43: pgcli 4.7.1-1.fc43 Β· BSD-3-Clause
- fedora 44: pgcli 4.7.1-1.fc44 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms