# PostgreSQL Query a PostgreSQL database — run parametrised SQL against a named connection and get back capped, paginated rows. Read your schema by querying information_schema and pg_catalog directly. Run these through `omni-cli` once a human has connected the platform (`omni-cli postgres login`). Full parameter and output schemas come from `omni-cli discovery postgres`. ## discovery | Command | What it does | Kind | |---|---|---| | `omni-cli postgres foreign-key list` | List foreign keys, showing which columns reference which table. | read | | `omni-cli postgres index list` | List indexes and the columns they cover. | read | | `omni-cli postgres server info` | Show the database server version and the identity this connection uses. | read | | `omni-cli postgres table describe` | Show a table's columns with their types, nullability, defaults and primary key. | read | | `omni-cli postgres table list` | List the tables and views in a schema. | read | ## query | Command | What it does | Kind | |---|---|---| | `omni-cli postgres query explain` | Show how the database would run a statement, without running it. | read | | `omni-cli postgres query run` | Run a SQL statement against a named connection and return the rows it produces. | write |