Add support for collation in partition functions and partition keys #3556
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.
Description
This commit adds the following changes to support collation in partition functions and partition keys:
Updated the CREATE PARTITION FUNCTION syntax to allow specifying the collation for the partition function parameter. This allows users to create partition functions with a specific collation, instead of always using the database default collation.
Modified the sys.babelfish_partition_function catalog table to include a new column 'input_parameter_collation' to store the collation of the partition function parameter.
Updated the code that handles partition functions and partition keys to enforce that the collation of the partitioning column must match the collation specified in the corresponding partition function. If they do not match, an error is raised.
Added tests to verify the new partition function collation support and the validation of partition key collation against the partition function collation.
Signed-off-by: Sumit Jaiswal sumiji@amazon.com
Issues Resolved
Task: BABEL-1373
Test Scenarios Covered
Use case based - Yes
Boundary conditions - Yes
Arbitrary inputs - Yes
Negative test cases - Yes
Minor version upgrade tests - Yes
Major version upgrade tests - Yes
Performance tests - NA
Tooling impact - NA
Client tests - NA
Check List
By submitting this pull request, I confirm that my contribution is under the terms of the Apache 2.0 and PostgreSQL licenses, and grant any person obtaining a copy of the contribution permission to relicense all or a portion of my contribution to the PostgreSQL License solely to contribute all or a portion of my contribution to the PostgreSQL open source project.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.