-
Notifications
You must be signed in to change notification settings - Fork 285
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
Bug with replica identity USING INDEX inheritance in 5.1 #721
Comments
Any chance you could share the schema of the parent table ( |
Was just checking why my unit test was passing here. Looks like I'd only covered replica identity FULL. If I can get your table's schema, I can try and work out a unit test with that to fix the bug and make sure to cover an index based on then as well. |
partman config:
parent_table definition (simplified - but should be enough to reproduce):
the full log of running
note: we recently migrated from v4.7.3 ,which didn't have this problem, to v5.1.0 as a matter of fact, we were perfectly fine with pg_partman not handling replica identity - because we have other code which handles that for partitioned tables. |
I have a fix for this up in the development branch (https://github.com/pgpartman/pg_partman). See commit 2052caf Thanks for the query suggestion to match the parent and child inherited indexes. Had to make one adjustment in that it needs to match on the child table's OID, not the parent's. I liked the commenting on it too to help clarify the joins, but I adjusted it a bit for how the joins made sense in my own head. Understand that you may have had the replica identities handled already, but everyone else may not so I did want to try and handle it in this extension for now. Honestly, I believe that it not being inherited in core is a bug, so hopefully they'll fix that upstream at some point. Will work on a unit test as well, but if you're able to test this too, that would be great. Hopefully have a new release out soon. Just need to run
with the update file in place where the PG instance can see it. Please don't run this on production, though, since this may not be the final 5.2.3 release version. |
Glad I did some unit testing first. So that query lookup only works properly if the schema of the partition set is in the search path. Adjusted things to just use OIDs more and get the actual child index name from pg_class instead of doing a ::regclass cast. Should be working better now. |
Thanks a lot for the quick fix!
I was not suggesting that pg_partman shouldn't handle it - and it's a great addition. apologies if it sounded like that.
Totally agree, I hope one day we will have interval partitioning (Oracle term) as part of core pg... maybe they can incorporate some of your work... |
I've released version 5.2.3. Not sure how long it takes RDS to get patch releases out. If this issue is still a problem when you have a chance to test that version in production, please let me know. |
Hi,
we are using pg_partman version 5.1.
when we run
CALL partman.run_maintenance_proc();
we get the following error:It seems like there is a bug in
partman.inherit_replica_identity
- it finds the correct replica identity index on the parent - however it assumes that the child table would have an index with the exact same name, which is not possible...instead - it should find the index on the child table which is attached to the parent index (assuming the index was attached to the parent index as part of the partition creation), something like:
The text was updated successfully, but these errors were encountered: