|
| 1 | +/* |
| 2 | + * Copyright 2017 - 2020 Crunchy Data Solutions, Inc. |
| 3 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | + * you may not use this file except in compliance with the License. |
| 5 | + * You may obtain a copy of the License at |
| 6 | + * |
| 7 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | + * |
| 9 | + * Unless required by applicable law or agreed to in writing, software |
| 10 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | + * See the License for the specific language governing permissions and |
| 13 | + * limitations under the License. |
| 14 | + */ |
| 15 | + |
1 | 16 | --- System Setup |
2 | 17 | SET application_name="container_setup"; |
3 | 18 |
|
| 19 | +CREATE EXTENSION IF NOT EXISTS pg_stat_statements; |
4 | 20 | CREATE EXTENSION IF NOT EXISTS pgaudit; |
5 | 21 |
|
6 | | -CREATE USER PGHA_USER LOGIN; |
7 | | -ALTER USER PGHA_USER PASSWORD 'PGHA_USER_PASSWORD'; |
8 | | - |
9 | | -CREATE DATABASE PGHA_DATABASE; |
10 | | -GRANT ALL PRIVILEGES ON DATABASE PGHA_DATABASE TO PGHA_USER; |
| 22 | +CREATE USER "PGHA_USER" LOGIN; |
| 23 | +ALTER USER "PGHA_USER" PASSWORD $$PGHA_USER_PASSWORD$$; |
11 | 24 |
|
12 | 25 | CREATE USER testuser2 LOGIN; |
13 | 26 | ALTER USER testuser2 PASSWORD 'customconfpass'; |
14 | 27 |
|
15 | | -CREATE DATABASE PGHA_DATABASE; |
16 | | -GRANT ALL PRIVILEGES ON DATABASE PGHA_DATABASE TO testuser2; |
| 28 | +CREATE DATABASE "PGHA_DATABASE"; |
| 29 | +GRANT ALL PRIVILEGES ON DATABASE "PGHA_DATABASE" TO testuser2; |
17 | 30 |
|
18 | 31 | --- PGHA_DATABASE Setup |
19 | 32 |
|
20 | | -\c PGHA_DATABASE |
| 33 | +\c "PGHA_DATABASE" |
21 | 34 |
|
| 35 | +CREATE EXTENSION IF NOT EXISTS pg_stat_statements; |
22 | 36 | CREATE EXTENSION IF NOT EXISTS pgaudit; |
23 | 37 |
|
24 | | -CREATE SCHEMA IF NOT EXISTS PGHA_USER; |
| 38 | +CREATE SCHEMA IF NOT EXISTS AUTHORIZATION "PGHA_USER"; |
25 | 39 |
|
26 | 40 | /* The following has been customized for the custom-config example */ |
27 | 41 |
|
28 | | -SET SESSION AUTHORIZATION PGHA_USER; |
| 42 | +SET SESSION AUTHORIZATION testuser2; |
29 | 43 |
|
30 | 44 | CREATE TABLE custom_config_table ( |
31 | 45 | KEY VARCHAR(30) PRIMARY KEY, |
|
0 commit comments