PQconnectdbParams
Description
Establishes a new connection with the database server.
Prototype
1
|
PGconn* PQconnectdbParams(const char* const* keywords, const char* const* values, int expand_dbname); |
Parameter
Keyword |
Description |
---|---|
keywords |
An array of strings, each of which is a keyword. |
values |
Value assigned to each keyword. |
expand_dbname |
When expand_dbname is non-zero, the dbname keyword value can be recognized as a connection string. Only dbname that first appears is expanded in this way, and any subsequent dbname value is treated as a database name. |
Return Value
PGconn * points to the object pointer that contains a connection. The memory is allocated by the function internally.
Precautions
This function establishes a new database connection using the parameters taken from two NULL-terminated arrays. Unlike PQsetdbLogin, the parameter set can be extended without changing the function signature. Therefore, use of this function (or its non-blocking analogs PQconnectStartParams and PQconnectPoll) is preferred for new application programming.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot