|
1 | | -# pg_ivm Extension |
2 | | - |
3 | | -[pg_ivm](https://github.com/sraoss/pg_ivm) is an open-source extension |
4 | | -that provides **Incremental View Maintenance (IVM)** for PostgreSQL, allowing |
5 | | -materialized views to be updated incrementally when base tables change. |
6 | | - |
7 | | -## Usage |
8 | | - |
9 | | -### 1. Add the pg_ivm extension image to your Cluster |
10 | | - |
11 | | -Define the `pg_ivm` extension under the `postgresql.extensions` section of |
12 | | -your `Cluster` resource. For example: |
13 | | - |
14 | | -```yaml |
15 | | -apiVersion: postgresql.cnpg.io/v1 |
16 | | -kind: Cluster |
17 | | -metadata: |
18 | | - name: cluster-pg-ivm |
19 | | -spec: |
20 | | - imageName: ghcr.io/cloudnative-pg/postgresql:18-minimal-trixie |
21 | | - instances: 1 |
22 | | - |
23 | | - storage: |
24 | | - size: 1Gi |
25 | | - |
26 | | - postgresql: |
27 | | - shared_preload_libraries: |
28 | | - - "pg_ivm" |
29 | | - postgresql: |
30 | | - extensions: |
31 | | - - name: pg_ivm |
32 | | - image: |
33 | | - reference: ghcr.io/cloudnative-pg/pg_ivm:1.13-18-trixie |
34 | | -``` |
35 | | -
|
36 | | -### 2. Enable the extension in a database |
37 | | -
|
38 | | -You can install `pg_ivm` in a specific database by creating or updating a |
39 | | -`Database` resource. For example, to enable it in the `app` database: |
40 | | - |
41 | | -```yaml |
42 | | -apiVersion: postgresql.cnpg.io/v1 |
43 | | -kind: Database |
44 | | -metadata: |
45 | | - name: cluster-pg-ivm-app |
46 | | -spec: |
47 | | - name: app |
48 | | - owner: app |
49 | | - cluster: |
50 | | - name: cluster-pg-ivm |
51 | | - extensions: |
52 | | - - name: pg_ivm |
53 | | -``` |
54 | | - |
55 | | -### 3. Verify installation |
56 | | - |
57 | | -Once the database is ready, connect to it with `psql` and run: |
58 | | - |
59 | | -```sql |
60 | | -\dx |
61 | | -``` |
62 | | - |
63 | | -You should see `pg_ivm` listed among the installed extensions. |
| 1 | +# pg_ivm |
| 2 | + |
| 3 | +[pg_ivm](https://github.com/sraoss/pg_ivm) is an open-source extension |
| 4 | +that provides **Incremental View Maintenance (IVM)** for PostgreSQL, allowing |
| 5 | +materialized views to be updated incrementally when base tables change. |
| 6 | + |
| 7 | +## Usage |
| 8 | + |
| 9 | +<!-- |
| 10 | +Usage: add instructions on how to use the extension with CloudNativePG. |
| 11 | +Include code snippets for Cluster and Database resources as needed. |
| 12 | +--> |
| 13 | + |
| 14 | +### 1. Add the pg_ivm extension image to your Cluster |
| 15 | + |
| 16 | +Define the `pg_ivm` extension under the `postgresql.extensions` section of |
| 17 | +your `Cluster` resource. For example: |
| 18 | + |
| 19 | +```yaml |
| 20 | +apiVersion: postgresql.cnpg.io/v1 |
| 21 | +kind: Cluster |
| 22 | +metadata: |
| 23 | + name: cluster-pg_ivm |
| 24 | +spec: |
| 25 | + imageName: ghcr.io/cloudnative-pg/postgresql:18-minimal-trixie |
| 26 | + instances: 1 |
| 27 | + |
| 28 | + storage: |
| 29 | + size: 1Gi |
| 30 | + |
| 31 | + postgresql: |
| 32 | + extensions: |
| 33 | + - name: pg_ivm |
| 34 | + image: |
| 35 | + reference: ghcr.io/cloudnative-pg/pg_ivm:1.0-18-trixie |
| 36 | +``` |
| 37 | +
|
| 38 | +### 2. Enable the extension in a database |
| 39 | +
|
| 40 | +You can install `pg_ivm` in a specific database by creating or updating a |
| 41 | +`Database` resource. For example, to enable it in the `app` database: |
| 42 | + |
| 43 | +```yaml |
| 44 | +apiVersion: postgresql.cnpg.io/v1 |
| 45 | +kind: Database |
| 46 | +metadata: |
| 47 | + name: cluster-pg_ivm-app |
| 48 | +spec: |
| 49 | + name: app |
| 50 | + owner: app |
| 51 | + cluster: |
| 52 | + name: cluster-pg_ivm |
| 53 | + extensions: |
| 54 | + - name: pg_ivm |
| 55 | + version: '1.13' |
| 56 | +``` |
| 57 | + |
| 58 | +### 3. Verify installation |
| 59 | + |
| 60 | +Once the database is ready, connect to it with `psql` and run: |
| 61 | + |
| 62 | +```sql |
| 63 | +\dx |
| 64 | +``` |
| 65 | + |
| 66 | +You should see `pg_ivm` listed among the installed extensions. |
| 67 | + |
| 68 | +## Maintainers |
| 69 | + |
| 70 | +This container image is maintained by @shuusan. |
| 71 | + |
| 72 | +--- |
| 73 | + |
| 74 | +## Licenses and Copyright |
| 75 | + |
| 76 | +This container image contains software that may be licensed under various |
| 77 | +open-source licenses. |
| 78 | + |
| 79 | +All relevant license and copyright information for the `pg_ivm` extension |
| 80 | +and its dependencies are bundled within the image at: |
| 81 | + |
| 82 | +```text |
| 83 | +/licenses/ |
| 84 | +``` |
| 85 | + |
| 86 | +By using this image, you agree to comply with the terms of the licenses |
| 87 | +contained therein. |
0 commit comments