Overview
Turn the results of your SQL SELECT statement into a CSV file. Extract your PostgreSQL data into files for easier delivery to clients and partners.
Variables
|
Name |
Reference |
Type |
Required |
Default |
Options |
Description |
|---|---|---|---|---|---|---|
|
Host |
POSTGRES_HOST |
Alphanumeric |
✅ |
None |
- |
The domain or the IP address of the database you want to connect to. |
|
Port |
POSTGRES_PORT |
Integer |
✅ |
5432 |
- |
Number for the database port to connect to. Defaults to 5432. |
|
Username |
POSTGRES_USERNAME |
Alphanumeric |
✅ |
None |
- |
Name of the user to connect to the database with. |
|
Password |
POSTGRES_PASSWORD |
Password |
➖ |
None |
- |
Password associated to the provided username. |
|
Database |
POSTGRES_DATABASE |
Alphanumeric |
✅ |
None |
- |
Name of the database in PostgreSQL to connect to. |
|
Extra URL Parameters |
POSTGRES_URL_PARAMETERS |
Alphanumeric |
➖ |
None |
- |
Extra parameters that will be placed at the end of the connection string, after the "?". Must be separated by "&". |
|
Query |
POSTGRES_QUERY |
Alphanumeric |
✅ |
None |
- |
A SELECT statement that returns data. Formatting is ignored. |
|
Workflows Folder Name |
POSTGRES_DESTINATION_FOLDER_NAME |
Alphanumeric |
➖ |
None |
- |
The folder structure that you want your CSV to be created in. If left blank, the file will be created in the home directory. |
|
Workflows File Name |
POSTGRES_DESTINATION_FILE_NAME |
Alphanumeric |
✅ |
output.csv |
- |
The file name that you want your generated CSV to have. |
|
Include Column Names as Header? |
POSTGRES_FILE_HEADER |
Boolean |
✅ |
True |
- |
If checked, your CSV file will include a header row with column names. |
YAML
Below is the YAML template
source:
template: PostgreSQL - Download Query Results to Workflows
inputs:
POSTGRES_HOST:
POSTGRES_PORT: '5432'
POSTGRES_USERNAME:
POSTGRES_PASSWORD:
POSTGRES_DATABASE:
POSTGRES_URL_PARAMETERS:
POSTGRES_QUERY:
POSTGRES_DESTINATION_FOLDER_NAME:
POSTGRES_DESTINATION_FILE_NAME: output.csv
POSTGRES_FILE_HEADER: true
type: TEMPLATE
guardrails:
retry_count: 1
retry_wait: 0h0m0s
runtime_cutoff: 1h0m0s
exclude_exit_code_ranges:
- 200
- 220
- 221
- 222
- 249