#455·dbmate

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

sql
--migrate:up transaction:false

in 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

  1. Do a postgres migration with CREATE INDEX CONCURRENTLY ... in a dbmate migrations file:
sql
-- migrate:up transaction:false

drop index concurrently my_index;

create index concurrently my_index on my_table (
    some_column
);
  1. 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.