forked from cloudnative-pg/cloudnative-pg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcluster-example-logical-source.yaml
44 lines (40 loc) · 1.18 KB
/
cluster-example-logical-source.yaml
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
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: cluster-example
spec:
instances: 1
imageName: ghcr.io/cloudnative-pg/postgresql:16
storage:
size: 1Gi
bootstrap:
initdb:
postInitApplicationSQL:
- CREATE TABLE numbers (i SERIAL PRIMARY KEY, m INTEGER)
- INSERT INTO numbers (m) (SELECT generate_series(1,10000))
- ALTER TABLE numbers OWNER TO app
- CREATE TABLE numbers_two (i SERIAL PRIMARY KEY, m INTEGER)
- INSERT INTO numbers_two (m) (SELECT generate_series(1,10000))
- ALTER TABLE numbers_two OWNER TO app
- CREATE SCHEMA another_schema
- ALTER SCHEMA another_schema OWNER TO app
- CREATE TABLE another_schema.numbers_three (i SERIAL PRIMARY KEY, m INTEGER)
- INSERT INTO another_schema.numbers_three (m) (SELECT generate_series(1,10000))
- ALTER TABLE another_schema.numbers_three OWNER TO app
managed:
roles:
- name: app
login: true
replication: true
---
apiVersion: postgresql.cnpg.io/v1
kind: Publication
metadata:
name: cluster-example-pub
spec:
name: pub
dbname: app
cluster:
name: cluster-example
target:
allTables: true