Export table
export_tableExport all rows from a PostgreSQL table to CSV or JSON with an optional row limit. Returns the serialised payload, row count, and a truncated flag to show whether the limit was reached.
Instructions
Serialise every row in schema.table (up to limit) to CSV or JSON. Schema and table names must be plain identifiers. Returns an object with format, row_count, truncated (bool — true when the row count hit limit), and content (the serialised payload as a string).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| table | Yes | ||
| format | No | csv | |
| schema | Yes | ||
| database | No | Optional: target a configured secondary (read-only) database by name; omit for the primary. Call list_databases to see the configured ids. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| format | Yes | ||
| content | Yes | ||
| row_count | Yes | ||
| truncated | Yes |