Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for collation in partition functions and partition keys #3556

Open
wants to merge 4 commits into
base: BABEL_5_X_DEV
Choose a base branch
from

Conversation

sumitj824
Copy link
Contributor

@sumitj824 sumitj824 commented Mar 7, 2025

Description

This commit adds the following changes to support collation in partition functions and partition keys:

  1. 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.

  2. 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.

  3. 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.

  4. 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

  • Commits are signed per the DCO using --signoff

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.

Sumit Jaiswal added 3 commits March 7, 2025 05:39
Signed-off-by: Sumit Jaiswal <sumiji@amazon.com>
Signed-off-by: Sumit Jaiswal <sumiji@amazon.com>
Signed-off-by: Sumit Jaiswal <sumiji@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants