PQsetdbLogin
Description
Establishes a new connection with the database server.
Prototype
PGconn* PQsetdbLogin(const char* pghost, const char* pgport, const char* pgoptions, const char* pgtty, const char* dbName, const char* login, const char* pwd);
Parameters
Keyword |
Description |
---|---|
pghost |
Name of the host to be connected. For details, see the host column described in Connection Parameters. |
pgport |
Port number of the host server. For details, see the port column described in Connection Parameters. |
pgoptions |
Command-line options to be sent to the server during running. For details, see the options column described in Connection Parameters. |
pgtty |
Ignored. (Previously, this option declares the output direction of server logs.) |
dbName |
Name of the database to be connected. For details, see the dbname column described in Connection Parameters. |
login |
Username for connection. For details, see the user column described in Connection Parameters. |
pwd |
Password used for authentication during connection. For details, see the password column described in Connection Parameters. |
Return Values
PGconn * points to the object pointer that contains a connection. The memory is allocated by the function internally.
Precautions
- This function is the predecessor of PQconnectdb with a fixed set of parameters. When an undefined parameter is called, its default value is used. Write NULL or an empty string for any one of the fixed parameters that is to be defaulted.
- If the dbName value contains an equal sign (=) or a valid prefix in the connection URL, it is taken as a conninfo string and passed to PQconnectdb, and the remaining parameters are consistent with PQconnectdbParams parameters.
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