Skip to content

Commit

Permalink
workload/schemachange: avoid commmenting on transient check constraints
Browse files Browse the repository at this point in the history
These check constraints are added temporarily while adding a
non-nullable column. We have seen flakes caused by the workload trying
to refer to them.

Release note: None
  • Loading branch information
rafiss committed Aug 12, 2024
1 parent 92203cc commit aff5d21
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/workload/schemachange/operation_generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -2785,6 +2785,8 @@ func (og *operationGenerator) commentOn(ctx context.Context, tx pgx.Tx) (*opStmt
SELECT 'INDEX ' || quote_ident(schema_name) || '.' || quote_ident(table_name) || '@' || quote_ident("index"->>'name') FROM indexes
UNION ALL
SELECT 'CONSTRAINT ' || quote_ident("constraint"->>'name') || ' ON ' || quote_ident(schema_name) || '.' || quote_ident(table_name) FROM constraints
-- Avoid temporary CHECK constraints created while adding NOT NULL columns.
WHERE "constraint"->>'name' NOT LIKE '%%auto_not_null'
%s`, onType))

commentables, err := Collect(ctx, og, tx, pgx.RowTo[string], q)
Expand Down

0 comments on commit aff5d21

Please sign in to comment.