I am trying to create a new PostgreSQL database using Liquibase. I am using this syntax:
<?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.0.xsd">
<changeSet id="23" author="pre_actions">
<sqlFile dbms="postgresql" path="src\main\resources\liquibase\createDB.sql" />
</changeSet>
[ERROR] Failed to execute goal org.liquibase:liquibase-maven-plugin:3.6.3:update (default-cli) on project cre_roles_schemas: Error setting up or running Liquibase: Migration failed for change set src/main/resources/liquibase/createDB.xml::23::pre_actions: [ERROR]
Reason: liquibase.exception.DatabaseException: ERROR: CREATE DATABASE cannot run inside a transaction block [Failed SQL: --Create DB octopusdb [ERROR] create database octopusdb owner octopus]
--The create database statement works fine directly from psql