Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions pkg/workload/schemachange/operation_generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -1333,15 +1333,15 @@ func (og *operationGenerator) createTable(ctx context.Context, tx pgx.Tx) (*opSt
}()
// Forward indexes for arrays were added in 23.1, so check the index
// definitions for them in mixed version states.
forwardIndexesOnArraysNotSupported, err := isClusterVersionLessThan(
forwardIndexesOnNewTypesSupported, err := isClusterVersionLessThan(
ctx,
tx,
clusterversion.ByKey(clusterversion.V23_1))
if err != nil {
return nil, err
}
hasUnsupportedForwardQueries, err := func() (bool, error) {
if !forwardIndexesOnArraysNotSupported {
hasUnsupportedForwardIdxQueries, err := func() (bool, error) {
if !forwardIndexesOnNewTypesSupported {
return false, nil
}
colInfoMap := make(map[tree.Name]*tree.ColumnTableDef)
Expand All @@ -1363,7 +1363,8 @@ func (og *operationGenerator) createTable(ctx context.Context, tx pgx.Tx) (*opSt
if err != nil {
return false, err
}
if typ.Family() == types.ArrayFamily {
if typ.Family() == types.ArrayFamily ||
typ.Family() == types.JsonFamily {
return true, err
}
}
Expand Down Expand Up @@ -1394,7 +1395,7 @@ func (og *operationGenerator) createTable(ctx context.Context, tx pgx.Tx) (*opSt
codesWithConditions{
{code: pgcode.Syntax, condition: hasUnsupportedTSQuery},
{code: pgcode.FeatureNotSupported, condition: hasUnsupportedTSQuery},
{code: pgcode.FeatureNotSupported, condition: hasUnsupportedForwardQueries},
{code: pgcode.FeatureNotSupported, condition: hasUnsupportedForwardIdxQueries},
}.add(opStmt.potentialExecErrors)
// Descriptor ID generator may be temporarily unavailable, so
// allow uncategorized errors temporarily.
Expand Down