> For the complete documentation index, see [llms.txt](https://upsolver.gitbook.io/content/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://upsolver.gitbook.io/content/quickstarts-1/jobs/transformation/data-targets/output-to-amazon-redshift.md).

# Output to Amazon Redshift

### Prerequisites

Ensure that you have an [Amazon Redshift](/content/reference-1/sql-commands/connections/create-connection/amazon-redshift.md) connection with the correct permissions to write to your target table. Additionally, this target table and columns should already exist within Redshift before writing to it using Upsolver.

You also need a storage connection that has access to the bucket you would like the job to use to store the intermediate files used while running the job.&#x20;

Finally, you should also have a staging table created previously that contains the data you intend to write to Redshift.

## Create a job writing to Redshift

After you have fulfilled the prerequisites, you can create an `INSERT` job as follows:

```sql
CREATE JOB load_data_to_redshift
    START_FROM = BEGINNING
    SKIP_FAILED_FILES = TRUE
    FAIL_ON_WRITE_ERROR = FALSE
AS INSERT INTO REDSHIFT <redshift_connection>.<schema_name>.<target_table_name> 
    MAP_COLUMNS_BY_NAME            
    SELECT orderid AS app_name
    FROM <glue_catalog_name>.<database_name>.<table_name>
    WHERE time_filter();
```

This example only uses a subset of all job options available when writing to Redshift. Depending on your use case, you may want to configure a different set of options.&#x20;

***

{% hint style="success" %}
**Learn More**&#x20;

For the full list of job options with syntax and detailed descriptions, see the transformation job options for [Amazon Redshift](/content/reference-1/sql-commands/jobs/create-job/transformation/job-options/amazon-redshift.md).

See the [INSERT](/content/reference-1/sql-commands/jobs/create-job/transformation/insert.md) SQL command reference for more details and examples.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://upsolver.gitbook.io/content/quickstarts-1/jobs/transformation/data-targets/output-to-amazon-redshift.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
