Skip to content

Commit 323fc5f

Browse files
Quote table name in OpSetReplicaIdentity (#206)
Fix table name quoting in the `OpSetReplicaIdentity` operation. This was causing the operation to fail on tables with case-sensitive names.
1 parent 763dabc commit 323fc5f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pkg/migrations/op_set_replica_identity.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ func (o *OpSetReplicaIdentity) Start(ctx context.Context, conn *sql.DB, stateSch
3333
}
3434

3535
// set the replica identity on the underlying table
36-
_, err := conn.ExecContext(ctx, fmt.Sprintf("ALTER TABLE %s REPLICA IDENTITY %s", o.Table, identitySQL))
36+
_, err := conn.ExecContext(ctx, fmt.Sprintf("ALTER TABLE %s REPLICA IDENTITY %s",
37+
pq.QuoteIdentifier(o.Table),
38+
identitySQL))
3739
return err
3840
}
3941

0 commit comments

Comments
 (0)