Skip to content

PostgreSQL List Tables

Lists all table names within a specified PostgreSQL schema. It authenticates using your configured PostgreSQL credentials and queries the Salt data service to return a formatted list and a JSON payload.
Preview

Usage

Use this node when you need to discover or verify the tables available in a particular PostgreSQL schema before building queries or downstream logic. Typical workflows place this node ahead of query-building or schema-inspection steps to programmatically enumerate available tables.

Inputs

FieldRequiredTypeDescriptionExample
credentials_pathTrueSTRINGPath to the stored PostgreSQL credentials that follow the 'postgres' credential template. The credentials are used to authenticate with the data service.
timeoutTrueINTMaximum time (in seconds) to wait for the service to respond before failing the request.30
schemaTrueSTRINGDatabase schema name to list tables from.public

Outputs

FieldTypeDescriptionExample
textSTRINGHuman-readable summary of the tables found in the specified schema.Tables in Schema: public - users - orders - products
jsonJSONRaw JSON response with the table list and related metadata.{"data": [{"table_name": "users"}, {"table_name": "orders"}, {"table_name": "products"}]}

Important Notes

  • Credentials: Requires a valid PostgreSQL credential set that matches the 'postgres' template.
  • Default schema: If unsure, use 'public' as the schema; many deployments default to it.
  • Timeouts: Large catalogs or slow networks may require increasing the timeout to avoid failures.
  • Output structure: The text is a readable summary; the JSON contains the underlying data for programmatic use.

Troubleshooting

  • Authentication error: Verify the credentials_path points to a valid file and that it uses the 'postgres' credential template.
  • Connection/timeout issues: Increase the timeout value or ensure network access to the data service is available.
  • Empty results: Confirm the schema name is correct and that the database user has permissions to list tables.
  • Unexpected JSON format: Inspect the JSON output for 'error' fields; correct the schema or credentials and retry.