| title | azdata postgres reference |
|---|---|
| titleSuffix | SQL Server Big Data Clusters |
| description | Reference article for azdata postgres commands. |
| author | MikeRayMSFT |
| ms.author | mikeray |
| ms.reviewer | seanw |
| ms.date | 06/02/2021 |
| ms.topic | reference |
| ms.prod | sql |
| ms.technology | big-data-cluster |
Applies to [!INCLUDE azure-data-cli-azdata]
The following article provides reference for the sql commands in the azdata tool. For more information about other azdata commands, see azdata reference
| Command | Description |
|---|---|
| azdata postgres shell | A command line shell interface for Postgres. See https://www.pgcli.com/ |
| azdata postgres query | The query command allows execution of PostgreSQL commands in a database session. |
A command line shell interface for Postgres. See https://www.pgcli.com/
azdata postgres shell [--dbname -d]
[--host]
[--port -p]
[--password -w]
[--no-password]
[--single-connection]
[--username -u]
[--pgclirc]
[--dsn]
[--list-dsn]
[--row-limit]
[--less-chatty]
[--prompt]
[--prompt-dsn]
[--list -l]
[--auto-vertical-output]
[--warn]
[--no-warn]Example command line to start the interactive experience.
azdata postgres shellExample command line using a provided database and user
azdata postgres shell --dbname <database> --username <username> --host <host>Example command line to start using a full connection-string.
azdata postgres shell --dbname postgres://user:passw0rd@example.com:5432/master Database name to connect to.
Host address of the postgres database.
Port number at which the postgres instance is listening.
Force password prompt.
Never prompt for password.
Do not use a separate connection for completions.
Username to connect to the postgres database.
Location of pgclirc file.
Use DSN configured into the [alias_dsn] section of pgclirc file.
List of DSN configured into the [alias_dsn] section of pgclirc file.
Set threshold for row limit prompt. Use 0 to disable prompt.
Skip intro on startup and goodbye on exit.
Prompt format (Default: "\u@\h:\d> ").
Prompt format for connections using DSN aliases (Default: "\u@\h:\d> ").
List available databases, then exit.
Automatically switch to vertical output mode if the result is wider than the terminal width.
Warn before running a destructive query.
Warn before running a destructive query.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Output format. Allowed values: json, jsonc, table, tsv. Default: json.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Increase logging verbosity. Use --debug for full debug logs.
The query command allows execution of PostgreSQL commands in a database session.
azdata postgres query --q -q
[--host]
[--dbname -d]
[--port -p]
[--username -u]List all tables in information_schema.
azdata postgres query --host <host> --username <username> -q "SELECT * FROM information_schema.tables"PostgreSQL query to execute.
Host address of the postgres database.
localhost
Database to run query in.
Port number at which the postgres instance is listening.
5432
Username to connect to the postgres database.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Output format. Allowed values: json, jsonc, table, tsv. Default: json.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Increase logging verbosity. Use --debug for full debug logs.
For more information about other azdata commands, see azdata reference.
For more information about how to install the azdata tool, see Install azdata.