1 |
4395
|
aaronmk
|
#!/bin/sh
|
2 |
|
|
# Creates analytical DB
|
3 |
|
|
|
4 |
|
|
selfDir="$(dirname -- "$0")"
|
5 |
|
|
|
6 |
6055
|
aaronmk
|
exec 2>>"$selfDir/../inputs/analytical_db/logs/make_analytical_db.log.sql" >&2
|
7 |
6047
|
aaronmk
|
|
8 |
6054
|
aaronmk
|
(set -x; date)
|
9 |
6048
|
aaronmk
|
|
10 |
6054
|
aaronmk
|
(set -x; "$selfDir/psql_verbose_vegbien" <<EOF
|
11 |
6053
|
aaronmk
|
TRUNCATE geoscrub_input;
|
12 |
|
|
INSERT INTO geoscrub_input SELECT * FROM geoscrub_input_view;
|
13 |
|
|
|
14 |
6042
|
aaronmk
|
SELECT make_family_higher_plant_group();
|
15 |
|
|
|
16 |
|
|
TRUNCATE analytical_stem;
|
17 |
|
|
INSERT INTO analytical_stem SELECT * FROM analytical_stem_view;
|
18 |
|
|
TRUNCATE analytical_aggregate;
|
19 |
|
|
INSERT INTO analytical_aggregate SELECT * FROM analytical_aggregate_view;
|
20 |
|
|
EOF
|
21 |
6056
|
aaronmk
|
)
|