Now that we know our common fields, creating an inheritance model is easy. First, we will create a parent table with the fields common to all the tables, using the following query:
CREATE TABLE chp02.hydrology ( gid SERIAL PRIMARY KEY, "name" text, hyd_type text, geom_type text, the_geom geometry );
If you are paying attention, you will note that we also added a geometry field as all of our shapefiles implicitly have this commonality. With inheritance, every record inserted in any of the child tables will also be saved in our parent table, only these records will be stored without the extra fields specified for the child tables.
To establish inheritance for a given table, we need to declare only the additional fields that ...