Skip to content

Commit

Permalink
Quote table name in OpSetReplicaIdentity (#206)
Browse files Browse the repository at this point in the history
Fix table name quoting in the `OpSetReplicaIdentity` operation. 

This was causing the operation to fail on tables with case-sensitive
names.
  • Loading branch information
andrew-farries authored Nov 24, 2023
1 parent 763dabc commit 323fc5f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/migrations/op_set_replica_identity.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ func (o *OpSetReplicaIdentity) Start(ctx context.Context, conn *sql.DB, stateSch
}

// set the replica identity on the underlying table
_, err := conn.ExecContext(ctx, fmt.Sprintf("ALTER TABLE %s REPLICA IDENTITY %s", o.Table, identitySQL))
_, err := conn.ExecContext(ctx, fmt.Sprintf("ALTER TABLE %s REPLICA IDENTITY %s",
pq.QuoteIdentifier(o.Table),
identitySQL))
return err
}

Expand Down

0 comments on commit 323fc5f

Please sign in to comment.