HomeMogDBMogDB StackUqbar
v2.1

Documentation:v2.1

Supported Versions:

Other Versions:

PQconnectdb

Function

PQconnectdb is used to establish a new connection with the database server.

Prototype

PGconn *PQconnectdb(const char *conninfo);

Parameter

Table 1 PQconnectdb parameter

Keyword Parameter Description
conninfo Connection string. For details about the fields in the string, see Connection Characters.

Return Value

PGconn * points to the object pointer that contains a connection. The memory is applied for by the function internally.

Precautions

  • This function establishes a new database connection using the parameters taken from the string conninfo.
  • The input parameter can be empty, indicating that all default parameters can be used. It can contain one or more values separated by spaces or contain a URL.

Example

For details, see Example.

Copyright © 2011-2024 www.enmotech.com All rights reserved.