[6X] Also set dependent array type encoding on ALTER TYPE ENCODING #14883
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a backport of main commit:
670ffac
An exception was added to the original commit to allow changing domain
type default encodings without needing a dependent array type because
dependent array types for domains are present on 7x but not 6x.
Original commit message:
Changing a type's default encoding using ALTER TYPE name SET DEFAULT
ENCODING should also set it's dependent array type to the same encoding.
This is the expected behavior when default compression encoding is
specified on CREATE TYPE. This also fixes pg_dump and pg_upgrade since
pg_dump relies on ALTER TYPE statements to set a type's default
encoding.
Without this change user defined types with their default encodings
specified on CREATE TYPE will set default encodings on the both the type
and it's depedent array type. The ALTER TYPE SET DEFAULT ENCODING
statement from pg_dump would not restore the default encoding of the
dependent array type.
This change prohibits altering types without a dependent array type.
This was allowed under the following assumptions.
array types from having their default encodings modified.
default encoding will not break existing tables because columns store
their own encoding.
While this means some internal types now cannot have their default
encodings changed, we will keep the default encodings of user defined
types and it's dependent array type in sync.
pipeline: https://cm.ci.gpdb.pivotal.io/teams/main/pipelines/6x-alter-encode