diff --git a/pkg/sql/opt/exec/execbuilder/relational.go b/pkg/sql/opt/exec/execbuilder/relational.go index 47871f9cffaa..5695566b18cf 100644 --- a/pkg/sql/opt/exec/execbuilder/relational.go +++ b/pkg/sql/opt/exec/execbuilder/relational.go @@ -157,7 +157,7 @@ func (b *Builder) buildRelational(e memo.RelExpr) (execPlan, error) { if err := b.evalCtx.Txn.SetSystemConfigTrigger(b.evalCtx.Codec.ForSystemTenant()); err != nil { return execPlan{}, errors.WithSecondaryError( unimplemented.NewWithIssuef(26508, - "schema change statement cannot follow a statement that has written in the same transaction"), + "the first schema change statement in a transaction must precede any writes"), err) } } diff --git a/pkg/sql/schema_changer_test.go b/pkg/sql/schema_changer_test.go index d9b1ed6aec2a..36bb0e988493 100644 --- a/pkg/sql/schema_changer_test.go +++ b/pkg/sql/schema_changer_test.go @@ -3579,7 +3579,7 @@ INSERT INTO t.kv VALUES ('a', 'b'); name: `insert-create`, firstStmt: `INSERT INTO t.kv VALUES ('e', 'f')`, secondStmt: `CREATE INDEX foo2 ON t.kv (v)`, - expectedErr: `schema change statement cannot follow a statement that has written in the same transaction`, + expectedErr: `the first schema change statement in a transaction must precede any writes`, }, // schema change at the end of a read only transaction. {