Project

General

Profile

« Previous | Next » 

Revision 6459

make_analytical_db: Create analytical_db views pointing to the analytical_* versions in the public schema

View differences:

bin/make_analytical_db
3 3

  
4 4
selfDir="$(dirname -- "$0")"
5 5

  
6
prefix=
7
. "$selfDir/vegbien_dest"
8

  
6 9
exec 2>>"$selfDir/../inputs/analytical_db/logs/make_analytical_db.log.sql" >&2
7 10

  
8 11
(set -x; date)
......
19 22
INSERT INTO analytical_stem SELECT * FROM analytical_stem_view;
20 23
TRUNCATE analytical_aggregate;
21 24
INSERT INTO analytical_aggregate SELECT * FROM analytical_aggregate_view;
25

  
26
-- Create analytical_db views pointing to the analytical_* versions in $public
27

  
28
DROP VIEW IF EXISTS analytical_db.analytical_stem;
29
CREATE VIEW analytical_db.analytical_stem AS
30
SELECT * FROM "$public".analytical_stem;
31
GRANT SELECT ON TABLE analytical_db.analytical_stem TO bien_read;
32

  
33
DROP VIEW IF EXISTS analytical_db.analytical_aggregate;
34
CREATE VIEW analytical_db.analytical_aggregate AS
35
SELECT * FROM "$public".analytical_aggregate;
36
GRANT SELECT ON TABLE analytical_db.analytical_aggregate TO bien_read;
22 37
EOF
23 38
)

Also available in: Unified diff