# cnpg-database

Logical database + role provisioned on a CloudNativePG cluster

This page is generated from [`kix/packages/experimental/cnpg-database`](https://github.com/kix-run/kix/tree/main/kix/packages/experimental/cnpg-database).

| | |
| --- | --- |
| Stability | Experimental |
| `package` value | `packages.experimental.cnpg-database` |
| Default aliases | `database` |

## Dependencies

Kix matches each dependency below to another package instance by instance name, alias, or role. To bind a specific instance, set [`deps.<name>`](/docs/reference/instances-and-composition/#deps) in your cluster definition. See [Declaring dependencies](/docs/reference/package-anatomy/#declaring-dependencies) for how required and optional dependencies work.

| Dependency | Requirement |
| --- | --- |
| `cnpgOperator` | Required |
| `postgres` | Required |
| `password` | Optional |

## Options

### `database`

PostgreSQL database name to create: a letter or underscore, then up to 62 letters, digits, underscores, or hyphens. postgres, template0, and template1 are refused.

- **Type:** `string matching the pattern [A-Za-z_][A-Za-z0-9_-]{0,62}`
- **Default:** the instance name

### `extensions`

Extensions to create on the new database (the Database's
`spec.extensions`), as a name or `{ name; version; }`. They must ship
in the cluster's operand image.

- **Type:** `list of (string or (submodule))`
- **Default:** `[ ]`

### `user`

PostgreSQL role name to create, which owns the database: a letter or underscore, then up to 62 letters, digits, underscores, or hyphens. CloudNativePG's reserved names are refused.

- **Type:** `string matching the pattern [A-Za-z_][A-Za-z0-9_-]{0,62}`
- **Default:** the instance name