---
name: "PQregisterComposites"
section: "3"
platform: "linux"
package: "libpqtypes-dev"
version: "1.5.1-9"
release: "Debian 12 (Bookworm)"
platforms: ["linux"]
url: "https://new.carta.tech/PQregisterComposites"
---

# PQregisterComposites(3)

Registers a composites.

## NAME

PQregisterComposites - Registers a composites.

## SYNOPSIS

**#include \<libpqtypes.h\>**\
 **int PQregisterComposites(PGconn \****conn***, PGregisterType \****types***,**\
\
                          **int** *count***);**

## DEPRECATED

*THIS FUNCTION IS DEPRECATED.  New applications should use PQregisterTypes.* *This function is now a wrapper to PQregisterTypes.*

## DESCRIPTION

*The PQregisterComposites() function allows an application* *to register one or more composites.  This function can be* *called as many times as an application needs on a PGconn.*

*This function must execute a query against the backend to retrieve type* *information for each composite, thus this should not be called from within* *a transaction.  It is recommended to register multiple composites at* *the same time to avoid round trip overhead.*

*The types argument is an array containing count composite types* *to register.  Composites do not use the typput or typget members of the* *PGregisterType structure, thus these memebrs are ignored.  If any composite* *does not exist, the register is aborted.*

*NOTE: The typname member of the PGregisterType structure can optionally* *contain the type's schema: schema.typname.*

*WARNING: PQparamCreate is only aware of types that have already been* *registered.  If you need to put a composite into a param, make sure it is first* *registered.*

## EXAMPLES

### Using PQregisterComposites

*The example registers two composite types.*

```

```

**PGregisterType comp\_types\[\] = {**\
 	**{"myschema.simple", NULL, NULL},**\
 	**{"complex", NULL, NULL}** **};**

**if (!PQregisterComposites(conn, comp\_types, 2))**\
 	**fprintf(stderr, "PQregisterComposites: %s\\n", PQgeterror());**

## RETURN VALUE

*On success, a non-zero value is returned.  On error, zero is* *returned and [PQgeterror(3)](/PQgeterror/3.md) will contain an error message.*

## EXAMPLES

*None.*

## AUTHOR

*A contribution of eSilo, LLC. for the PostgreSQL Database Management System.* *Written by Andrew Chernow and Merlin Moncure.*

## REPORTING BUGS

*Report bugs to \<libpqtypes@esilo.com\>.*

## COPYRIGHT

*Copyright (c) 2011 eSilo, LLC. All rights reserved.*\
 *This is free software; see the source for copying conditions.* *There is NO warranty; not even for MERCHANTABILITY or  FITNESS* *FOR A PARTICULAR PURPOSE.*

## SEE ALSO

*[pqt-handlers(3)](/pqt-handlers/3.md), [PQputf(3)](/PQputf/3.md), [PQgetf(3)](/PQgetf/3.md)*
