> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-parallel-read-in-order-multi-part.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> Documentation for CREATE NAMED COLLECTION

# CREATE NAMED COLLECTION

Creates a new named collection.

<Note>
  DDL-created named collections can be enabled on select ClickHouse Cloud services. Contact Support to confirm availability.
</Note>

**Syntax**

```sql theme={null}
CREATE [OR REPLACE] NAMED COLLECTION [IF NOT EXISTS] name [ON CLUSTER cluster] AS
key_name1 = 'some value' [[NOT] OVERRIDABLE],
key_name2 = 'some value' [[NOT] OVERRIDABLE],
key_name3 = 'some value' [[NOT] OVERRIDABLE],
...
```

`OR REPLACE` and `IF NOT EXISTS` cannot be used together. `CREATE OR REPLACE` of an existing collection
replaces it entirely: keys and overridability flags absent from the new definition are removed.

Overriding a stored key when using the collection requires `SHOW NAMED COLLECTIONS SECRETS` on that collection,
including keys marked `OVERRIDABLE`. Keys marked `NOT OVERRIDABLE` cannot be overridden.
Dictionary sources follow the same rule. The privilege is checked when the dictionary is created, attached, or restored.
When the dictionary is loaded, only keys marked `NOT OVERRIDABLE` are enforced.

**Example**

```sql theme={null}
CREATE NAMED COLLECTION foobar AS a = '1', b = '2' OVERRIDABLE;
CREATE OR REPLACE NAMED COLLECTION foobar AS a = '2', c = '3';
```

**Related statements**

* [ALTER NAMED COLLECTION](/reference/statements/alter/named-collection)
* [DROP NAMED COLLECTION](/reference/statements/drop#drop-function)

**See Also**

* [Named collections guide](/concepts/features/configuration/server-config/named-collections)

**Part of:** `CREATE`
