Skip to content

Commit

Permalink
drop mirror: ignore `cannot execute DROP PUBLICATION in a read-only t…
Browse files Browse the repository at this point in the history
…ransaction (SQLSTATE 25006)` (#2381)

still report this as an error during validation

Co-authored-by: Kevin Biju <[email protected]>
  • Loading branch information
serprex and heavycrystal authored Dec 20, 2024
1 parent b87d0a3 commit 863e237
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion flow/connectors/postgres/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -1149,7 +1149,9 @@ func (c *PostgresConnector) PullFlowCleanup(ctx context.Context, jobName string)
}

if publicationExists {
if _, err := c.conn.Exec(ctx, "DROP PUBLICATION IF EXISTS "+publicationName); err != nil {
if _, err := c.conn.Exec(
ctx, "DROP PUBLICATION IF EXISTS "+publicationName,
); err != nil && !shared.IsSQLStateError(err, pgerrcode.ReadOnlySQLTransaction) {
return fmt.Errorf("error dropping publication: %w", err)
}
}
Expand Down

0 comments on commit 863e237

Please sign in to comment.