This repository was archived by the owner on Feb 26, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sql
51 lines (36 loc) · 1.36 KB
/
setup.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
SET application_name="container_setup";
create extension postgis;
create extension postgis_topology;
create extension fuzzystrmatch;
create extension postgis_tiger_geocoder;
create extension pg_stat_statements;
create extension pgaudit;
create extension plr;
alter user postgres password 'PG_ROOT_PASSWORD';
create user PG_PRIMARY_USER with REPLICATION PASSWORD 'PG_PRIMARY_PASSWORD';
create user PG_USER with password 'PG_PASSWORD';
create table primarytable (key varchar(20), value varchar(20));
grant all on primarytable to PG_PRIMARY_USER;
create database PG_DATABASE;
grant all privileges on database PG_DATABASE to PG_USER;
\c PG_DATABASE
create extension postgis;
create extension postgis_topology;
create extension fuzzystrmatch;
create extension postgis_tiger_geocoder;
create extension pg_stat_statements;
create extension pgaudit;
create extension plr;
create extension hstore;
\c PG_DATABASE PG_USER;
create schema PG_USER;
create table PG_USER.testtable (
name varchar(30) primary key,
value varchar(50) not null,
updatedt timestamp not null
);
insert into PG_USER.testtable (name, value, updatedt) values ('CPU', '256', now());
insert into PG_USER.testtable (name, value, updatedt) values ('MEM', '512m', now());
grant all on PG_USER.testtable to PG_PRIMARY_USER;
alter table geometry_columns owner to PG_USER;
alter table spatial_ref_sys owner to PG_USER;