Skip to content

Conversation

@pavan-postgres
Copy link

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.

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.
@keithf4
Copy link
Collaborator

keithf4 commented Dec 2, 2025

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!

@keithf4 keithf4 added this to the 5.5 milestone Dec 2, 2025
@keithf4 keithf4 self-assigned this Dec 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants