When executing a migration file without a transaction (by using --evolve-tx-off), creating multiple indexes concurrently in a single migration file is throwing a evolve exception in postgresql 11.20
It is not throwing any error when
Exception message:
Evolve.EvolveException: 'Error executing script: V202307111148__create_index_testresult.sql after 3 ms. 25001: CREATE INDEX CONCURRENTLY cannot be executed within a pipeline Sql query: -- evolve-tx-off CREATE UNIQUE INDEX CONCURRENTLY test_testresult ON public.test(testresult); C... 25001: CREATE INDEX CONCURRENTLY cannot be executed within a pipeline'
This exception didn’t occur in PostgreSQL 10, but this is found in later on some major versions like PostgreSQL 11,12,13
Steps to Reproduce
Create a table named test with the below syntax in a PostgreSQL 11.02 database
create table test(
id serial not null,
testname varchar(32) not null,
testresult varchar(32) not null,
constraint test_pkey primary key(id)
)
After creating the table test, create a versioned migration file with contents as shown below
-- evolve-tx-off
CREATE UNIQUE INDEX CONCURRENTLY test_testname ON public.test(testname);
CREATE UNIQUE INDEX CONCURRENTLY test_testresult ON public.test(testresult);
Connect to this database from the application and run it.
You will come across the exception as mentioned above.
Two indexes should be created without any exception
Actual Behavior
Getting Evolve exception
Evolve.EvolveException: 'Error executing script: V202307111148__create_index_testresult.sql after 3 ms. 25001: CREATE INDEX CONCURRENTLY cannot be executed within a pipeline Sql query: -- evolve-tx-off CREATE UNIQUE INDEX CONCURRENTLY test_testresult ON public.test(testresult); C... 25001: CREATE INDEX CONCURRENTLY cannot be executed within a pipeline'
Environment
Description
When executing a migration file without a transaction (by using
--evolve-tx-off
), creating multiple indexes concurrently in a single migration file is throwing a evolve exception inpostgresql 11.20
It is not throwing any error when
Exception message:
This exception didn’t occur in PostgreSQL 10, but this is found in later on some major versions like PostgreSQL 11,12,13
Steps to Reproduce
Create a table named
test
with the below syntax in a PostgreSQL 11.02 databaseAfter creating the table
test
, create a versioned migration file with contents as shown belowConnect to this database from the application and run it.
You will come across the exception as mentioned above.
Actual Project
Expected/Desired Behavior
Actual Behavior
Getting Evolve exception
Additional Context