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