| Goal | Find in case of each base table that participates in a table inheritance hierarchy the path to the table from the top-level table. Use table inheritance carefully because, for instance, certain constraints are not inherited and must be redefined on child tables. Also make sure that the identifier of each child table in an inheritance hierarchy is a hyponym of the identifier of its parent table. |
|---|---|
| Notes | The query finds transitive closure of tables. In other words it finds all possible paths between tables where it is possible to reach from one table to another based on parent-child relationships that have been established by using table inheritance. |
| Type | General (Overview of some aspect of the database.) |
| License | MIT (opens in new tab) |
| Data Source | system catalog only |
| SQL Query |
|
Collections
This query belongs to the following collections:
Find problems about base tables
A selection of queries that return information about the data types, field sizes, default values as well as general structure of base tables. Contains all the types of queries - problem detection, software measure, and general overview
Find problems by overview
Queries that results point to different aspects of database that might have problems. A human reviewer has to decide based on the results as to whether there are problems or not .
Lexicon bad smells and linguistic antipatterns
Queries made to find the occurrences of lexicon bad smells and linguistic antipatterns
| Name | Description |
|---|---|
| Find problems about base tables | A selection of queries that return information about the data types, field sizes, default values as well as general structure of base tables. Contains all the types of queries - problem detection, software measure, and general overview |
| Find problems by overview | Queries that results point to different aspects of database that might have problems. A human reviewer has to decide based on the results as to whether there are problems or not . |
| Lexicon bad smells and linguistic antipatterns | Queries made to find the occurrences of lexicon bad smells and linguistic antipatterns |
Categories
This query is classified under the following categories:
Naming
Queries of this category provide information about the style of naming.
Table inheritance
Queries of this category provide information about the inheritance between base tables.
| Name | Description |
|---|---|
| Naming | Queries of this category provide information about the style of naming. |
| Table inheritance | Queries of this category provide information about the inheritance between base tables. |
Further reading and related materials:
| Reference |
|---|
| https://www.postgresql.org/docs/current/tutorial-inheritance.html |
| https://dba.stackexchange.com/questions/157398/using-table-inheritance-instead-of-mapping-tables/157425#157425 |
| https://stackoverflow.com/questions/3074535/when-to-use-inherited-tables-in-postgresql |
| Smell "No hyponymy/hypernymy in class hierarchies": Abebe, S.L., Haiduc, S., Tonella, P. and Marcus, A., 2011, September. The effect of lexicon bad smells on concept location in source code. In 2011 IEEE 11th International Working Conference on Source Code Analysis and Manipulation (pp. 125-134). IEEE. |