Specification of the desired Database.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
allowConnections
boolean
Maps to the `ALLOW_CONNECTIONS` parameter of `CREATE DATABASE` and
`ALTER DATABASE`. If false then no one can connect to this database.
builtinLocale
string
Maps to the `BUILTIN_LOCALE` parameter of `CREATE DATABASE`. This
setting cannot be changed. Specifies the locale name when the
builtin provider is used. This option requires `localeProvider` to
be set to `builtin`. Available from PostgreSQL 17.
cluster
object required
The name of the PostgreSQL cluster hosting the database.
name
string
Name of the referent.
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
collationVersion
string
Maps to the `COLLATION_VERSION` parameter of `CREATE DATABASE`. This
setting cannot be changed.
connectionLimit
integer
Maps to the `CONNECTION LIMIT` clause of `CREATE DATABASE` and
`ALTER DATABASE`. How many concurrent connections can be made to
this database. -1 (the default) means no limit.
databaseReclaimPolicy
string
The policy for end-of-life maintenance of this database.
enum: delete, retain
encoding
string
Maps to the `ENCODING` parameter of `CREATE DATABASE`. This setting
cannot be changed. Character set encoding to use in the database.
ensure
string
Ensure the PostgreSQL database is `present` or `absent` - defaults to "present".
enum: present, absent
extensions
[]object
The list of extensions to be managed in the database
ensure
string
Specifies whether an object (e.g schema) should be present or absent
in the database. If set to `present`, the object will be created if
it does not exist. If set to `absent`, the extension/schema will be
removed if it exists.
enum: present, absent
name
string required
Name of the object (extension, schema, FDW, server)
schema
string
The name of the schema in which to install the extension's objects,
in case the extension allows its contents to be relocated. If not
specified (default), and the extension's control file does not
specify a schema either, the current default object creation schema
is used.
version
string
The version of the extension to install. If empty, the operator will
install the default version (whatever is specified in the
extension's control file)
fdws
[]object
The list of foreign data wrappers to be managed in the database
ensure
string
Specifies whether an object (e.g schema) should be present or absent
in the database. If set to `present`, the object will be created if
it does not exist. If set to `absent`, the extension/schema will be
removed if it exists.
enum: present, absent
handler
string
Name of the handler function (e.g., "postgres_fdw_handler").
This will be empty if no handler is specified. In that case,
the default handler is registered when the FDW extension is created.
name
string required
Name of the object (extension, schema, FDW, server)
options
[]object
Options specifies the configuration options for the FDW.
ensure
string
Specifies whether an option should be present or absent in
the database. If set to `present`, the option will be
created if it does not exist. If set to `absent`, the
option will be removed if it exists.
enum: present, absent
name
string required
Name of the option
value
string required
Value of the option
owner
string
Owner specifies the database role that will own the Foreign Data Wrapper.
The role must have superuser privileges in the target database.
usage
[]object
List of roles for which `USAGE` privileges on the FDW are granted or revoked.
name
string required
Name of the usage
type
string
The type of usage
enum: grant, revoke
validator
string
Name of the validator function (e.g., "postgres_fdw_validator").
This will be empty if no validator is specified. In that case,
the default validator is registered when the FDW extension is created.
icuLocale
string
Maps to the `ICU_LOCALE` parameter of `CREATE DATABASE`. This
setting cannot be changed. Specifies the ICU locale when the ICU
provider is used. This option requires `localeProvider` to be set to
`icu`. Available from PostgreSQL 15.
icuRules
string
Maps to the `ICU_RULES` parameter of `CREATE DATABASE`. This setting
cannot be changed. Specifies additional collation rules to customize
the behavior of the default collation. This option requires
`localeProvider` to be set to `icu`. Available from PostgreSQL 16.
isTemplate
boolean
Maps to the `IS_TEMPLATE` parameter of `CREATE DATABASE` and `ALTER
DATABASE`. If true, this database is considered a template and can
be cloned by any user with `CREATEDB` privileges.
locale
string
Maps to the `LOCALE` parameter of `CREATE DATABASE`. This setting
cannot be changed. Sets the default collation order and character
classification in the new database.
localeCType
string
Maps to the `LC_CTYPE` parameter of `CREATE DATABASE`. This setting
cannot be changed.
localeCollate
string
Maps to the `LC_COLLATE` parameter of `CREATE DATABASE`. This
setting cannot be changed.
localeProvider
string
Maps to the `LOCALE_PROVIDER` parameter of `CREATE DATABASE`. This
setting cannot be changed. This option sets the locale provider for
databases created in the new cluster. Available from PostgreSQL 16.
name
string required
The name of the database to create inside PostgreSQL. This setting cannot be changed.
owner
string required
Maps to the `OWNER` parameter of `CREATE DATABASE`.
Maps to the `OWNER TO` command of `ALTER DATABASE`.
The role name of the user who owns the database inside PostgreSQL.
schemas
[]object
The list of schemas to be managed in the database
ensure
string
Specifies whether an object (e.g schema) should be present or absent
in the database. If set to `present`, the object will be created if
it does not exist. If set to `absent`, the extension/schema will be
removed if it exists.
enum: present, absent
name
string required
Name of the object (extension, schema, FDW, server)
owner
string
The role name of the user who owns the schema inside PostgreSQL.
It maps to the `AUTHORIZATION` parameter of `CREATE SCHEMA` and the
`OWNER TO` command of `ALTER SCHEMA`.
servers
[]object
The list of foreign servers to be managed in the database
ensure
string
Specifies whether an object (e.g schema) should be present or absent
in the database. If set to `present`, the object will be created if
it does not exist. If set to `absent`, the extension/schema will be
removed if it exists.
enum: present, absent
fdw
string required
The name of the Foreign Data Wrapper (FDW)
name
string required
Name of the object (extension, schema, FDW, server)
options
[]object
Options specifies the configuration options for the server
(key is the option name, value is the option value).
ensure
string
Specifies whether an option should be present or absent in
the database. If set to `present`, the option will be
created if it does not exist. If set to `absent`, the
option will be removed if it exists.
enum: present, absent
name
string required
Name of the option
value
string required
Value of the option
usage
[]object
List of roles for which `USAGE` privileges on the server are granted or revoked.
name
string required
Name of the usage
type
string
The type of usage
enum: grant, revoke
tablespace
string
Maps to the `TABLESPACE` parameter of `CREATE DATABASE`.
Maps to the `SET TABLESPACE` command of `ALTER DATABASE`.
The name of the tablespace (in PostgreSQL) that will be associated
with the new database. This tablespace will be the default
tablespace used for objects created in this database.
template
string
Maps to the `TEMPLATE` parameter of `CREATE DATABASE`. This setting
cannot be changed. The name of the template from which to create
this database.