Flyway PostgreSQL Transactional Lock Setting
Published 15 January 2025
Description
Whether transactional advisory locks should be used with PostgreSQL.
If false, session-level locks will be used instead.
This should be set to false
for statements such as CREATE INDEX CONCURRENTLY
.
Type
Boolean
Default
true
Usage
Flyway Desktop
This can't be configured via Flyway Desktop, although it will be honoured.
Command-line
./flyway -postgresql.transactional.lock=false info
TOML Configuration File
[flyway.postgresql]
transactional.lock = false
Configuration File
flyway.postgresql.transactional.lock=false
Environment Variable
FLYWAY_POSTGRESQL_TRANSACTIONAL_LOCK=false
API
PostgreSQLConfigurationExtension configurationExtension = configuration.getPluginRegister().getPlugin(PostgreSQLConfigurationExtension.class)
configurationExtension.setTransactionalLock(false);
Gradle
flyway {
pluginConfiguration = [
postgresqlTransactionalLock: 'false'
]
}
Maven
<configuration>
<pluginConfiguration>
<postgresqlTransactionalLock>false</postgresqlTransactionalLock>
</pluginConfiguration>
</configuration>