Copy To (Export)
AI-generatedSummary
Export data from PostgreSQL by executing a SELECT query and outputting the results in CSV, TSV, or custom-delimited file format, optionally splitting the export into multiple files.
Inputs
- Query (required) — A SELECT SQL query defining the data to export.
- Output Format (required) — Format of the output file: CSV (comma-separated), TSV (tab-separated), or custom delimiter.
- Custom Delimiter — Delimiter character for custom format; defaults to '|'. Only applicable if Output Format is 'Custom Delimiter'.
- Include Header Row — Whether to include column names as the first row in the output file; defaults to true.
- File Name — Name of the output file (e.g., 'export.csv').
- Binary Property Name — Name of the binary property in which the file data will be stored in the output item; defaults to 'data'.
- Max Rows Per File — Maximum number of rows per output file to split the export into multiple files; 0 means no limit and export is a single file.
- Options — Additional CSV/TSV output options such as quote character, representation for NULL values, and character encoding.
Output shape
One or more output items each containing the exported file as binary data and JSON metadata.
Outputs one item per exported file. If maxRowsPerFile is set to split the output, multiple items are returned with sequentially numbered file names (e.g., file-1.csv, file-2.csv). Each item contains a JSON summary with row count, file size in bytes, execution time in milliseconds, file name, and format, alongside a binary property with the file content formatted per settings. Errors in execution are reported per item if continue on fail is enabled; otherwise, execution stops on error.