Search Postgresql Archives

Re: Fwd: [LibPQ] Trying PQconnectStart: it doesn't seem to connect

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



	Alessandro Agosto wrote:

> I'm not yet within select/poll cycle, this is the first call that should
> return CONNECTION_OK or CONNECTION_BAD (refering to docs).

That would be the behavior of PQconnectdb(), not PQconnectStart().

Have you read that part of the doc:

<quote>
Other states might also occur during (and only during) an asynchronous
connection procedure. These indicate the current stage of the connection
procedure and might be useful to provide feedback to the user for example.
These statuses are:

CONNECTION_STARTED

    Waiting for connection to be made. 
CONNECTION_MADE

    Connection OK; waiting to send. 
CONNECTION_AWAITING_RESPONSE

    Waiting for a response from the server. 
CONNECTION_AUTH_OK

    Received authentication; waiting for backend start-up to finish. 
CONNECTION_SSL_STARTUP

    Negotiating SSL encryption. 
CONNECTION_SETENV

    Negotiating environment-driven parameter settings. 

Note that, although these constants will remain (in order to maintain
compatibility), an application should never rely upon these occurring in a
particular order, or at all, or on the status always being one of these
documented values. An application might do something like this:

switch(PQstatus(conn))
{
	case CONNECTION_STARTED:
	    feedback = "Connecting...";
	    break;

	case CONNECTION_MADE:
	    feedback = "Connected to server...";
	    break;

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux