I am trying to create a db on PostgreSQL using liquibase. This is my dbchangelog file
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.8.xsd">
<changeSet author="testuser" id="3">
<sql dbms="postgresql"
endDelimiter=";">
CREATE DATABASE testdb;
</sql>
</changeSet>
</databaseChangeLog
When i try to run liquibase update
from my project directory i am getting
Unexpected error running Liquibase: ERROR: CREATE DATABASE cannot run inside a transaction block [Failed SQL: (0) CREATE DATABASE testdb]
I saw setting AUTOCOMMIT = ON in PostgreSQL will solve this issue.But this method only works for PostgreSQL 9.4 and below . But i am using AWS RDS PostgreSQL 9.6.8