Refactor partition suffix logic to allow custom child prefixes#830
Open
pavan-postgres wants to merge 1 commit intopgpartman:developmentfrom
Open
Refactor partition suffix logic to allow custom child prefixes#830pavan-postgres wants to merge 1 commit intopgpartman:developmentfrom
pavan-postgres wants to merge 1 commit intopgpartman:developmentfrom
Conversation
Updated the logic for determining suffixes of partitioned tables.
Previous implementation always appended '_p' for partitioned tables:
v_suffix := format('%s%s', CASE WHEN p_table_partition THEN '_p' END, p_suffix);
New logic allows using a simple naming convention for child tables without affecting existing behavior:
v_suffix := format('%s%s',
CASE
WHEN p_table_partition AND p_simple_naming THEN '_'
WHEN p_table_partition THEN '_p'
END,
p_suffix
);
This change enables specifying a custom prefix/suffix for child table names (via `p_suffix`) while preserving the original '_p' behavior for partitions that do not use simple naming. It makes the code more flexible without breaking existing functionality.
Collaborator
|
Don't think I'm going to be able to get this into the next release, but I do like the idea. Will come back to review this after next release is out. Thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Updated the logic for determining suffixes of partitioned tables.
Previous implementation always appended '_p' for partitioned tables:
New logic allows using a simple naming convention for child tables without affecting existing behavior:
This change enables specifying a custom prefix/suffix for child table names (via
p_suffix) while preserving the original '_p' behavior for partitions that do not use simple naming. It makes the code more flexible without breaking existing functionality.