Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CREATE SUBSCRIPTION PostgreSQL statement not detected as non-transactional #1992

Closed
razvannegrea opened this issue Apr 22, 2018 · 1 comment
Closed

Comments

@razvannegrea
Copy link

@razvannegrea razvannegrea commented Apr 22, 2018

Which version and edition of Flyway are you using?

Flyway 5.0.7 community

If this is not the latest version, can you reproduce the issue with the latest one as well?

(Many bugs are fixed in newer releases and upgrading will often resolve the issue)

Which client are you using? (Command-line, Java API, Maven plugin, Gradle plugin)

Command-line

Which database are you using (type & version)?

Postgresql 10.1

Which operating system are you using?

Ubuntu

What did you do?

(Please include the content causing the issue, any relevant configuration settings, the SQL statement that failed (if relevant) and the command you ran.)

We are trying to create a PG logical replication setup.
As part of this setup, on the server where data is to replicated, we need to run the following statement, after the database model is created:

CREATE SUBSCRIPTION ifdb_subscription CONNECTION 'host=xxx.xxx.xxx.xxx dbname=xxxx user=xxxx password=xxxx port=5432' PUBLICATION ifdb_publication;

What did you expect to see?

A successful migration message, just like for other migrations.

What did you see instead?

Migration V1.2__Setup_replication.sql failed

SQL State : 25001
Error Code : 0
Message : ERROR: CREATE SUBSCRIPTION ... WITH (create_slot = true) cannot run inside a transaction block

@razvannegrea razvannegrea changed the title Non-transactional Postgresql statement not detected, thus executed inside a transaction and resulting in failture Non-transactional Postgresql statement not detected, thus executed inside a transaction and resulting in failure Apr 22, 2018
@axelfontaine axelfontaine added this to the Flyway 5.1.0 milestone Apr 26, 2018
@axelfontaine axelfontaine changed the title Non-transactional Postgresql statement not detected, thus executed inside a transaction and resulting in failure CREATE SUBSCRIPTION PostgreSQL statement not detected as non-transactional May 23, 2018
axelfontaine added a commit to flyway/flywaydb.org that referenced this issue May 23, 2018
@axelfontaine
Copy link
Contributor

@axelfontaine axelfontaine commented May 23, 2018

Good catch! This has now been fixed for both CREATE SUBSCRIPTION and DROP SUBSCRIPTION.

dohrayme pushed a commit to dohrayme/flyway that referenced this issue Feb 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.