---
name: "confdb_key_create"
section: "3"
platform: "linux"
package: "corosync-dev"
version: "1.4.6-1.1"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/confdb_key_create"
---

# confdb\_key\_create(3)

Add a new key/value pair to the Configuration Database

## NAME

confdb\_key\_create - Add a new key/value pair to the Configuration Database

## SYNOPSIS

**#include \<corosync/confdb.h\>**

**confdb\_error\_t confdb\_key\_create(confdb\_handle\_t** *handle***,** **unsigned***int* **parent\_object\_handle** *,* **void** *\*key\_name* **,** **void** *\*value* **,** **int** *value\_len* **);**

## DESCRIPTION

The **confdb\_key\_create** function adds a new key/value pair to the specified parent object. Parent objects may contain many keys and also sub-objects. The names of keys are not required to be unique: if you call **confdb\_key\_create** twice with the same parameters you will create two identical keys in the database. The parent object should already exist in the database, it can be OBJECT\_PARENT\_HANDLE (the top-level object) but this is not recommended. Unlike objects, keys do not have handles, so you can't go directly to a non-unique key without using the **confdb\_key\_iter** function.

## RETURN VALUE

This call returns the CONFDB\_OK value if successful, otherwise an error is returned.

## ERRORS

The errors are undocumented.

## SEE ALSO

[**confdb\_overview**(8)](/confdb_overview/8.md), [**confdb\_initialize**(3)](/confdb_initialize/3.md), [**confdb\_finalize**(3)](/confdb_finalize/3.md), [**confdb\_dispatch**(3)](/confdb_dispatch/3.md), [**confdb\_object\_create**(3)](/confdb_object_create/3.md), [**confdb\_object\_destroy**(3)](/confdb_object_destroy/3.md), [**confdb\_object\_parent\_get**(3)](/confdb_object_parent_get/3.md), [**confdb\_key\_create**(3)](/confdb_key_create/3.md), [**confdb\_key\_delete**(3)](/confdb_key_delete/3.md), [**confdb\_key\_get**(3)](/confdb_key_get/3.md), [**confdb\_key\_replace**(3)](/confdb_key_replace/3.md), [**confdb\_object\_find\_start**(3)](/confdb_object_find_start/3.md), [**confdb\_object\_find**(3)](/confdb_object_find/3.md), [**confdb\_object\_iter\_start**(3)](/confdb_object_iter_start/3.md), [**confdb\_object\_iter**(3)](/confdb_object_iter/3.md), [**confdb\_key\_iter\_start**(3)](/confdb_key_iter_start/3.md), [**confdb\_key\_iter**(3)](/confdb_key_iter/3.md),
