1
|
SELECT util.search_path_append('util');
|
2
|
|
3
|
SELECT force_update_view('"occurrence_all"', $$
|
4
|
SELECT "*TREE-row_num" AS "occurrence_all-row_num", *
|
5
|
/* directional joins ensure that the PostgreSQL query planner always joins
|
6
|
starting with the TREE table */
|
7
|
FROM ("REF_RESEARCH_STATION"
|
8
|
NATURAL RIGHT JOIN ("REF_UNIT"
|
9
|
NATURAL RIGHT JOIN ("COUNTY"
|
10
|
NATURAL RIGHT JOIN ("PLOT"
|
11
|
NATURAL RIGHT JOIN ("COND"
|
12
|
NATURAL LEFT JOIN "REF_HABTYP_DESCRIPTION"
|
13
|
NATURAL RIGHT JOIN ("SUBPLOT"
|
14
|
NATURAL RIGHT JOIN ("TREE"
|
15
|
NATURAL LEFT JOIN "REF_SPECIES"
|
16
|
NATURAL LEFT JOIN "REF_PLANT_DICTIONARY"
|
17
|
)))))))
|
18
|
$$);
|
19
|
|
20
|
SELECT mk_subset_by_row_num_func('"occurrence_all"', 'occurrence_all-row_num');
|