Getting pq: syntax error at or near "transaction" when running migration with transaction:false
Author: brookbackCreated Jun 22, 2023Updated Sep 5, 2025
Labelsbug
Description
Having
--migrate:up transaction:falsein a dbmate migration file produces a syntax error.
- Version: dbmate version 2.4.0
- Database: postgres v13
- Operating System: macOS 12.6.3
Steps To Reproduce
- Do a postgres migration with
CREATE INDEX CONCURRENTLY ...in a dbmate migrations file:
-- migrate:up transaction:false
drop index concurrently my_index;
create index concurrently my_index on my_table (
some_column
);- Run with
dbmate --no-schema-dump up.
Actual Behavior
Applying: 20230621121155_my_migration.sql
Error: pq: syntax error at or near "transaction"It seems this is some bug/limitation with the pq lib, but I just wanted to give a heads up.
Source: amacneil/dbmate