The problem I was having "went away" when I moved to another Solaris 2.6 machine with the latest patch level.
I've also tested it on Solaris 8, HP-UX 11.00 and Linux, so it looks like there is a connect bug in a release 2.6,
but seems to be fixed with later patches.

Thanks for the help.

Joe

Tom Lane wrote:

Joe Murphy <joe.murphy@aersoft.ie> writes:
>> The re-connect underlying call to connect returns -1 and errno = 0, so
>> it thinks the connection is "in progress" and tries
>> to complete the connection - but hangs on the select (poll)

Well, you have a bug in connect() if it's returning the wrong errno
in the multi-thread case.

However, our code in fe-connect.c reads like this:

    if (connect(conn->sock, &conn->raddr.sa, conn->raddr_len) < 0)
    {
        if (SOCK_ERRNO == EINTR)
            /* Interrupted system call - we'll just try again */
            goto retry1;

        if (SOCK_ERRNO == EINPROGRESS || SOCK_ERRNO == EWOULDBLOCK || SOCK_ERRNO == 0)
        {
            /*
             * This is fine - we're in non-blocking mode, and the
             * connection is in progress.
             */
            conn->status = CONNECTION_STARTED;
        }
        else
        {
            /* Something's gone wrong */
            connectFailureMessage(conn, SOCK_ERRNO);
            goto connect_errReturn;
        }

I wonder whether it's really a good idea to treat errno == 0 as
indicating "connection in progress".  Does anyone know of a platform
where zero is actually what is returned in this case?  The man pages
I can find all say that EINPROGRESS is returned.

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                        Joe Murphy - AerSoft Limited
             2 Northumberland Avenue, Dun Laoghaire, Co. Dublin.            
  phone: +353-1-2301166     direct: +353-1-2145953     fax: +353-1-2301167  
  mailto:joe@aersoft.com   mobile: +353-86-8526181  http://www.aersoft.com 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~