Обсуждение: Request for example using pqconnectstart,pqconnectpoll part.

Поиск
Список
Период
Сортировка

Request for example using pqconnectstart,pqconnectpoll part.

От
Om Prakash Jaiswal
Дата:
Hi,
Please provide a sample example using pqconnectstart , pqconnectpoll to make  a asynchronous connection and executing a query for client application in C.
It is part of

libpq - C Library.

I am able to do query using PQconnectdb and PQexec.
I have also used PQconnectdb and PQsendQuery.  PQconnectdb is blocking call, now I want to replace PQconnectdb with non blocking connection pqconnectstart and pqconnectpoll.

Please provide an example.


Thanks in advance.

Regards
Om Prakash
DBA, Bangalore

Re: Request for example using pqconnectstart,pqconnectpoll part.

От
Laurenz Albe
Дата:
On Thu, 2021-02-04 at 15:27 +0000, Om Prakash Jaiswal wrote:
> Please provide a sample example using pqconnectstart , pqconnectpoll to make
> a asynchronous connection and executing a query for client application in C.
> It is part of libpq - C Library.
> I am able to do query using PQconnectdb and PQexec.
> I have also used PQconnectdb and PQsendQuery.  PQconnectdb is blocking call,
>  now I want to replace PQconnectdb with non blocking connection pqconnectstart and pqconnectpoll.
> 
> Please provide an example.

I used it in
https://github.com/laurenz/pgreplay/blob/master/database.c#L404
but it certainly is not the most concise example.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com