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