I am building a database in PostgreSQL 9.2 with the PostGIS 2.0 extension. The database consists of a schema called Water which contains water related geographic features (as example, boreholes and water filters as points with coordinates). Each feature type, eg. water filters or boreholes, is in a separate table. In other words, water filters are in a table named water_filters and boreholes are in a table named Boreholes and the tables are in a schema called Water.
In the same database I have a schema called maintenance with non-geographic tables. The maintenance tables houses the maintenance records of the respective geographic features. The maintenance table for water_filters will house, for example, a unique number/name/identifier for a water filter and the latest service date.
Thus far, I have selected for the geographic features (eg water filters) a unique number/name/identifier as the primary key. For the corresponding maintenance table the number/name/identifier of the geographic features was selected as a foreign key.
- Is this the correct way to define relations between two tables in PostgrreSQL/GIS?
- How do I view the relations in QGIS 1.8.0?
Thanks in advance