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 for regular table inheritance #152

lossendae opened this Issue Jan 27, 2018 · 3 comments


None yet
2 participants

lossendae commented Jan 27, 2018


Native partition are handled by partition functions (#134) but i didn't find how to check for regular table inheritance (relkind 'r').

Is it supported ?


This comment has been minimized.


theory commented Jan 27, 2018

No. Want to add it?

@theory theory added the enhancement label Jan 27, 2018


This comment has been minimized.

lossendae commented Feb 25, 2018

Hi Theory,

Yes I would but would mind giving me some guidance on how to proceed ? I'm not familiar with the patch and the *.in files.

Which one are created by hand ? Which one is generated ? Should i provide everything in a PR ? Or only the tests and then you will add the patches and version number ?


This comment has been minimized.


theory commented Feb 27, 2018

Don't worry about the patch files; they get updated before release. The pg_class relkind column doesn't have a letter to represent inheritance ("r" is an ordinary table). There is the relhassubclass column, though, so you can tell if a table has children; would be pretty easy to implement a has_subclass() function similar to how has_table(), but with the additional check that relhassubclass is true. I think you would need to join to pg-inherits to determine if a table is a child. The is_clustered() function is structured similarly to that.

fluca1978 added a commit to fluca1978/pgtap that referenced this issue Oct 2, 2018

First implementation of tests for inheritance.
Adds two families of functions:
- has_inherited_tables
- hasnt_inherited_tables

Both accept a table name and ensures the table has (or hasn't) a inherited
chain (i.e., pg_class.relhassubclass is true).

See discussion and ticket <theory#152>.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment