diff --git a/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/alter_table_add_column.go b/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/alter_table_add_column.go index 91e1cd8dc878..b889c159d2b0 100644 --- a/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/alter_table_add_column.go +++ b/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/alter_table_add_column.go @@ -43,11 +43,6 @@ func alterTableAddColumn( b BuildCtx, tn *tree.TableName, tbl *scpb.Table, stmt tree.Statement, t *tree.AlterTableAddColumn, ) { d := t.ColumnDef - // We don't support handling zone config related properties for tables, so - // throw an unsupported error. - fallBackIfSubZoneConfigExists(b, t, tbl.TableID) - fallBackIfRegionalByRowTable(b, t, tbl.TableID) - // Check column non-existence. { elts := b.ResolveColumn(tbl.TableID, d.Name, ResolveParams{ diff --git a/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/alter_table_alter_primary_key.go b/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/alter_table_alter_primary_key.go index 7a9fdcae4766..76468a6160eb 100644 --- a/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/alter_table_alter_primary_key.go +++ b/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/alter_table_alter_primary_key.go @@ -71,8 +71,6 @@ func alterPrimaryKey( // be removed to fully support `ALTER PRIMARY KEY`. fallBackIfShardedIndexExists(b, t, tbl.TableID) fallBackIfPartitionedIndexExists(b, t, tbl.TableID) - fallBackIfRegionalByRowTable(b, t.n, tbl.TableID) - fallBackIfSubZoneConfigExists(b, t.n, tbl.TableID) inflatedChain := getInflatedPrimaryIndexChain(b, tbl.TableID) if !haveSameIndexColsByKind(b, tbl.TableID, inflatedChain.oldSpec.primary.IndexID, @@ -434,18 +432,6 @@ func fallBackIfShardedIndexExists(b BuildCtx, t alterPrimaryKeySpec, tableID cat }) } -// fallBackIfRegionalByRowTable panics with an unimplemented -// error if it's a REGIONAL BY ROW table because we need to -// include the implicit REGION column when constructing the -// new primary key. -func fallBackIfRegionalByRowTable(b BuildCtx, t tree.NodeFormatter, tableID catid.DescID) { - _, _, rbrElem := scpb.FindTableLocalityRegionalByRow(b.QueryByID(tableID)) - if rbrElem != nil { - panic(scerrors.NotImplementedErrorf(t, "ALTER PRIMARY KEY on a REGIONAL BY ROW table "+ - "is not yet supported.")) - } -} - func mustRetrieveCurrentPrimaryIndexElement( b BuildCtx, tableID catid.DescID, ) (res *scpb.PrimaryIndex) { diff --git a/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/alter_table_drop_column.go b/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/alter_table_drop_column.go index 84384e565688..e5274c69279e 100644 --- a/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/alter_table_drop_column.go +++ b/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/alter_table_drop_column.go @@ -29,8 +29,6 @@ func alterTableDropColumn( stmt tree.Statement, n *tree.AlterTableDropColumn, ) { - fallBackIfSubZoneConfigExists(b, n, tbl.TableID) - fallBackIfRegionalByRowTable(b, n, tbl.TableID) checkSafeUpdatesForDropColumn(b) checkRegionalByRowColumnConflict(b, tbl, n) diff --git a/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/create_index.go b/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/create_index.go index 8f5ccf8d2623..e8b1e33b75b3 100644 --- a/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/create_index.go +++ b/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/create_index.go @@ -118,11 +118,6 @@ func CreateIndex(b BuildCtx, n *tree.CreateIndex) { panic(pgerror.Newf(pgcode.DuplicateRelation, "index with name %q already exists", n.Name)) } } - // We don't support handling zone config related properties for tables required - // for regional by row tables. - if _, _, tbl := scpb.FindTable(relationElements); tbl != nil { - fallBackIfRegionalByRowTable(b, n, tbl.TableID) - } _, _, partitioning := scpb.FindTablePartitioning(relationElements) if partitioning != nil && n.PartitionByIndex != nil && n.PartitionByIndex.ContainsPartitions() { diff --git a/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/drop_index.go b/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/drop_index.go index 01ab1ea80ebd..6602012aa8f1 100644 --- a/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/drop_index.go +++ b/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/drop_index.go @@ -93,9 +93,6 @@ func maybeDropIndex( if sie == nil { panic(errors.AssertionFailedf("programming error: cannot find secondary index element.")) } - // We don't support handling zone config related properties for tables, so - // throw an unsupported error. - fallBackIfSubZoneConfigExists(b, nil, sie.TableID) panicIfSchemaChangeIsDisallowed(b.QueryByID(sie.TableID), n) // Cannot drop the index if not CASCADE and a unique constraint depends on it. if n.DropBehavior != tree.DropCascade && sie.IsUnique && !sie.IsCreatedExplicitly { diff --git a/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/helpers.go b/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/helpers.go index 3117eba70f95..695e22a1ba7a 100644 --- a/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/helpers.go +++ b/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/helpers.go @@ -858,20 +858,6 @@ func makeSwapIndexSpec( return in, temp } -// fallBackIfSubZoneConfigExists determines if the table has a subzone -// config. Normally this logic is used to limit index related operations, -// since dropping indexes will need to remove entries of sub zones from -// the zone config. -func fallBackIfSubZoneConfigExists(b BuildCtx, n tree.NodeFormatter, id catid.DescID) { - { - tableElts := b.QueryByID(id) - if _, _, elem := scpb.FindIndexZoneConfig(tableElts); elem != nil { - panic(scerrors.NotImplementedErrorf(n, - "sub zone configs are not supported")) - } - } -} - // ExtractColumnIDsInExpr extracts column IDs used in expr. It's similar to // schemaexpr.ExtractColumnIDs but this function can also extract columns // added in the same transaction (e.g. for `ADD COLUMN j INT CHECK (j > 0);`,