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

Support declarative partitioning #11

Merged
merged 4 commits into from
Feb 8, 2023

Conversation

fljdin
Copy link
Collaborator

@fljdin fljdin commented Jan 18, 2023

Enhances API with "partitions" and "subpartitions" new tables. Add steps in materialize_foreign_table() to support partitioned tables and partitions creation when needed. See README.md for further description.

Supports LIST (with default partition), RANGE, HASH and composite partitioning. The last position of a HASH partition is read before partition creation to obtain modulus value. Positions must start at 1.

Enhances API with "partitions" and "subpartitions" new tables. Add steps in
materialize_foreign_table() to support partitioned tables and partitions creation
when needed. See README.md for further description.

Supports LIST (with default partition), RANGE, HASH and composite partitioning.
The last position of a HASH partition is read before partition creation to
obtain modulus value. Positions must start at 1.
Copy link
Collaborator

@laurenz laurenz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just a code review; I didn't test it yet.

Thanks for the contribution! This is promising!

db_migrator--0.9.0.sql Show resolved Hide resolved
db_migrator--0.9.0.sql Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@laurenz laurenz added the enhancement New feature or request label Jan 19, 2023
Copy link
Collaborator

@laurenz laurenz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more think I noticed after reading the ora_migrator patch.

db_migrator--0.9.0.sql Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@laurenz
Copy link
Collaborator

laurenz commented Jan 20, 2023

I thought some more about partition boundaries.
Perhaps they can be passed as text[]: one value for HASH, two for RANGE and arbitrarily many for LIST.
Then there is the problem of numbers vs. other data types. Perhaps we can require that the values in the text[] are already properly quoted, so that we can simply use them as they are.

Reviewed by laurenz
partitions.values and subpartitions.valuess must be arrays depending on
partition type Removes position and migrate columns.

Related to cybertec-postgresql#12
Use of v_translate_expression inside partitions and subpartitions refresh step.
As values represents an array of specification, it loops over unnested values to
perform translation before reconstruct array.
@laurenz
Copy link
Collaborator

laurenz commented Feb 8, 2023

Ok, I think I have tortured you enough with my complaints, and thanks for your patience.
I will take it from here and get this merged.

@fljdin
Copy link
Collaborator Author

fljdin commented Feb 8, 2023

Good news! All of your suggestions sounded good to me, thanks for your feedback!

@fljdin fljdin requested a review from laurenz February 8, 2023 10:01
@laurenz laurenz merged commit e0eab88 into cybertec-postgresql:master Feb 8, 2023
@laurenz
Copy link
Collaborator

laurenz commented Feb 8, 2023

Thanks again.

@fljdin fljdin deleted the declarative-partitioning branch February 9, 2023 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants