In the preceding recipe, we created temporary tables to store original data, as well as tables containing MaPIR information to be queried later by users. The following steps allow other users to access those tables:
- First, create the table supermarkets to store the information extracted from the dataset, and the table supermarkets_mapir to store the MaPIR-related information for each supermarket register. Execute the following command:
CREATE TABLE chp12.supermarkets ( sup_id serial, the_geom geometry(Point,4326), latitude numeric, longitude numeric, PRIMARY KEY (sup_id) ); CREATE TABLE chp12.supermarkets_mapir ( sup_id int REFERENCES chp12.supermarkets (sup_id), cellid int, levelid int );
- Now, create a trigger function ...