Nasleđivanje tabela u PostgreSQL bazi podataka

PostgreSQL ima mehanizam za nasleđivanje između tabela (https://www.postgresql.org/docs/10/ddl-inherit.html)

Primer roditeljske tabele cities i deteta capitals:

CREATE TABLE cities (
    name            text,
    population      float,
    altitude        int     -- in feet
);

CREATE TABLE capitals (
    state           char(2)
) INHERITS (cities);

Dokumentacija PostgreSQLa kaže da postoji 1 ograničenje tj. mana u konceptu nasleđivanja tabela, a to je:

A serious limitation of the inheritance feature is that indexes (including unique constraints) and foreign key constraints only apply to single tables, not to their inheritance children.