-
Notifications
You must be signed in to change notification settings - Fork 92
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
Handle natively partitioned tables #134
Comments
I think add |
Created the following function for myself in order to be able to keep testing for now. Seems to work. However, maybe
|
Yeah, I would expect that to work. I'd just duplicate all these functions, replacing "table" with "partition":
Those are the functions I can see right now that are specific to |
Except shouldn't any partition test functions accept the parent table as well? partitions_are() is the most obvious example of why you'd want that, but I don't think any of these functions make sense if they ignore the table that a partition belongs to. For partition_owner_is(), can partitions even have different owners? |
Well, should I don't know how the new partition stuff works (is there new partition support now?). Can/should a parent table have data in it? I mean the root table, of course (assuming the old inheritance partition scheme). To me, that's not a partition, so the partition test functions should ignore it. But maybe things are different in 10.0? Maybe we should also have an |
FYI, the functions for this should now be looking for a lower case "p" instead of upper case.
|
Where are we on this feature? |
EDIT: Sorry, I had my thinking backwards. My I've add the two functions for checking if a parent table is partitioned to the README for my testing and been using it without issue https://github.com/keithf4/pg_partman/blob/master/test/README_test.md#partitioning-in-postgresql-10 |
I would also expect the existing functions ( |
If I just copy the materialized-view test to make |
Hrm, I'm thinking those ought to be |
Yes, for Assuming that |
Yeah, I think I like |
How about:
|
Looks good! |
Hrm. Do you know how to tell which table the parent of a partition table? I've not spotted anything useful in the catalogs, but I must be missing it… |
Ah, found it in pg_inherits. |
Something important to remember: a "child" table can inherit from multiple parents. It would be best if everything that accepts It'd also be good if partitions_are() had a version that took |
Is that true for partitions? |
Ahh, I didn't realize this was strictly testing the declarative partitioning. I have a feeling this is going to trip some people up, though hopefully the fact that it's only 10+ will limit that. |
Doing some development work on pg_partman for native partitioning and was confused for a while why some tests were failing. Then realized they only began to fail once I natively partitioned a table. Specifically, I found that
has_table
fails since it is only looking for a relkind of'r'
in pg_class. Was going to suggest checking for bothr
andP
(new partitioned relkind), but appears that the_rexists()
function only accepts a single relkind argument. So either need a whole newhas_
function for partitioned tables, or maybe some way to accept multiple relkinds when checking for existence?The text was updated successfully, but these errors were encountered: