While the interfaces of PostgreSQL and AWS Redshift are superficially similar, there are subtle differences. Some data types that exist in PostgreSQL are not supported by Redshift. The same applies to query types. For example, DAP client library makes use of combined INSERT or UPDATE statements (a.k.a. MERGE), and these are not supported by Redshift either.
If you want to insert data into a Redshift table, the following steps might help:
- Trigger an incremental query with the output format Parquet.
- Upload the Parquet files to AWS S3.
- Create a temporary table in Redshift (CREATE TEMP TABLE) that has the exact same structure as the table to be updated.
- Use the COPY command in Redshift to load the data into the temporary table.
- Use DELETE to remove those rows in the target table that have a matching primary key in the temporary table.
- Use INSERT to add all rows in the temporary table to the target table.
We are experimenting with automating the above process, and as such DAP client library may support this flow in the future. However, when (or if) this feature is added is subject to the product roadmap.
As of today, DAP client library only supports PostgreSQL and MySQL as target databases. Future versions will come with Microsoft SQL Server and Oracle connectivity enabled. For more information about which database engines are officially supported, check out the client library documentation.