Advanced Postgres SQL Features PostgreSQL Prev Next Chapter 63. Time Travel More Advanced Features Having covered the basics of using Postgres SQL to access your data, we will now discuss those features of Postgres that distinguish it from conventional data managers. Examples in this section can also be found in advance.sql in the tutorial directory.
Inheritance Let's create two classes.
The capitals class contains state capitals which are also cities. Naturally, the capitals class should inherit from cities. The type of the attribute population is float , a native Postgres type for double precision floating point numbers. State capitals have an extra attribute, state, that shows their state. In Postgres , a class can inherit from zero or more other classes, and a query can reference either all instances of a class or all instances of a class plus all of its descendants.