Re: Error: no connection to the server

Поиск
Список
Период
Сортировка
От Albe Laurenz
Тема Re: Error: no connection to the server
Дата
Msg-id A737B7A37273E048B164557ADEF4A58B53844008@ntex2010i.host.magwien.gv.at
обсуждение исходный текст
Ответ на Error: no connection to the server  (Marco Bambini <marco@sqlabs.com>)
Список pgsql-general
Marco Bambini wrote:
> I have a multithreaded C client and sometimes I receive the "no connection to the server" error
> message.
> I haven't found any documentation about it and about how to fix this issue.
> 
> Anyone can point me to the right direction?

The error message is reported in interfaces/libpq/fe-exec.c:

static bool
PQsendQueryStart(PGconn *conn)
{
    if (!conn)
        return false;

    /* clear the error string */
    resetPQExpBuffer(&conn->errorMessage);

    /* Don't try to send if we know there's no live connection. */
    if (conn->status != CONNECTION_OK)
    {
        printfPQExpBuffer(&conn->errorMessage,
                          libpq_gettext("no connection to the server\n"));
        return false;
    }

So it looks like you closed the connection (maybe in some other thread)
and then try to reuse it.

Yours,
Laurenz Albe

В списке pgsql-general по дате отправления:

Предыдущее
От: Marco Bambini
Дата:
Сообщение: Error: no connection to the server
Следующее
От: David Wilson
Дата:
Сообщение: Re: Background worker plus language handler for Andl: OK?