postgresql_16:7.1.57.2 Parameters
PostgreSQL 16 > Reference > SQL Commands > CREATE COLLATION > Parameters
IF NOT EXISTS
Do not throw an error if a collation with the same name already exists. A notice is issued in this case. Note that there is no guarantee that the existing collation is anything like the one that would have been created.
*name*
The name of the collation. The collation name can be schema-qualified. If it is not, the collation is defined in the current schema. The collation name must be unique within that schema. (The system catalogs can contain collations with the same name for other encodings, but these are ignored if the database encoding does not match.)
*locale*
The locale name for this collation. See (see postgresql_16:4.9.2.2) and (see postgresql_16:4.9.2.2) for details.
If *provider* is libc, this is a shortcut for setting LC_COLLATE and LC_CTYPE at once. If you specify *locale*, you cannot specify either of those parameters.
*lc_collate*
If *provider* is libc, use the specified operating system locale for the LC_COLLATE locale category.
*lc_ctype*
If *provider* is libc, use the specified operating system locale for the LC_CTYPE locale category.
*provider*
Specifies the provider to use for locale services associated with this collation. Possible values are icu (if the server was built with ICU support) or libc. libc is the default. See (see postgresql_16:4.9.1.4) for details.
DETERMINISTIC
Specifies whether the collation should use deterministic comparisons. The default is true. A deterministic comparison considers strings that are not byte-wise equal to be unequal even if they are considered logically equal by the comparison. PostgreSQL breaks ties using a byte-wise comparison. Comparison that is not deterministic can make the collation be, say, case- or accent-insensitive. For that, you need to choose an appropriate LOCALE setting *and* set the collation to not deterministic here.
Nondeterministic collations are only supported with the ICU provider.
*rules*
Specifies additional collation rules to customize the behavior of the collation. This is supported for ICU only. See (see postgresql_16:4.9.2.3) for details.
*version*
Specifies the version string to store with the collation. Normally, this should be omitted, which will cause the version to be computed from the actual version of the collation as provided by the operating system. This option is intended to be used by pg_upgrade for copying the version from an existing installation.
See also (see postgresql_16:7.1.3) for how to handle collation version mismatches.
*existing_collation*
The name of an existing collation to copy. The new collation will have the same properties as the existing one, but it will be an independent object.