Hi all,
I'm trying to create an AWS Redshift DB with data taken from a number of different CSV files.
I've tested the script locally using Postgres and all seems to be working well (produces the following types of output:
- DO
- $$
- BEGIN
- UPDATE public.example_db SET name = 'abc' WHERE other_name = '123';
- IF not found THEN
- INSERT INTO public. example_db (name, other_name) VALUES ('abc, '123');
- END IF;
- END;
- $$
- LANGUAGE plpgsql;
)
HOWEVER, when running this against a Redshift DB, it generates the standard insert:
- INSERT INTO public.example_db (name, other_name) VALUES ('abc', '123');
My changeset xml looks like this:
- <changeSet id="2.1" author="example" runOnChange="true">
- <loadData file="/resources/002_resources/files/net_names.csv"
- schemaName="public"
- tableName="example_db">
- </loadData>
- <loadUpdateData file="/resources/002_resources/files/others.csv"
- schemaName="public"
- primaryKey="name"
- tableName="example_db">
- </loadUpdateData>
- <loadUpdateData file="/resources/002_resources/files/more.csv"
- schemaName="public"
- primaryKey="name"
- tableName="example_db">
- </loadUpdateData>
- <loadUpdateData file="/resources/002_resources/files/foo_bar.csv"
- schemaName="public"
- primaryKey="name"
- tableName="example_db">
- </loadUpdateData>
- <sqlFile path="../resources/002_resources/fill_in_nulls.sql" relativeToChangelogFile="true" />
- <rollback>
- <sqlFile path="../resources/002_resources/rollback.sql" relativeToChangelogFile="true" />
- </rollback>
- </changeSet>
liquibase --defaultsFile=../../IdeaProjects/migrations/sandbox.properties updateSQL
With the defaults file containing the following information:
url=jdbc:redshift://amazonURL.com:1234/dbName?ssl=true&sslfactory=com.amazon.redshift.ssl.NonValidatingFactory
driver=com.amazon.redshift.jdbc41.Driver
databaseClass=liquibase.ext.redshift.database.RedshiftDatabase
username=123
password=abc
defaultSchemaName=public
changeLogFile=changelog.xml
Any help would be greatly appreciated. If you need any extra information please let me know!