Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l7hJR-0002HT-56 for pgsql-general@arkaria.postgresql.org; Thu, 04 Feb 2021 16:16:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l7hJP-00066z-TT for pgsql-general@arkaria.postgresql.org; Thu, 04 Feb 2021 16:16:55 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l7hJP-00066q-IA for pgsql-general@lists.postgresql.org; Thu, 04 Feb 2021 16:16:55 +0000 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1l7hJM-0008De-Dz for pgsql-general@postgresql.org; Thu, 04 Feb 2021 16:16:54 +0000 Received: by mail-ed1-x533.google.com with SMTP id df22so4903368edb.1 for ; Thu, 04 Feb 2021 08:16:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=fbgv5uI2ibpCD6NBJ5YGQk52E01gbm3yftkNKNqhAEI=; b=rMRL8uMUJeWlQD/il9Vjd0D0fDZ8YSDJyARNyjqeSZ0qLGRTHS78HbZ0GvBhfI9mv5 92KHDOcl81+Ff6DjxqmnsE2cP/jimrXlJ0UiBOq4bLRKQaBY8ZoqzCsSrYVuS3n9LXkr 9V5YxWLAz+LaeEJGmFR0I8ZjanO1B0ZkQVFZTpKHq+HlytpxJ6M+3Z6EiY30WVR4jULZ WgNB7oTKJhaRSfXsA1BqKNRGRuOm25VZwk4Jujxz2qv6WlHNgG+cqGQbzrfv2UbTXay0 ZhS3qSp+d3zM9Pc/BQRVxUJ+92sGMOqZyvihDM64lQ2Lf+7ccauvIsT0RyR5ymtVagRr FK4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=fbgv5uI2ibpCD6NBJ5YGQk52E01gbm3yftkNKNqhAEI=; b=jTq9wyZYXqVB7wJvmR6OBDQcsaOCJPc98SSCRRu5Gqhx/4wCLMORP1uzR3ITybdkkS 2UIvrn6e5/TJOKoT+ShxXWTIbXmjqlUFnwg5ojpsI7D9bX7fMCGrNqcwvvPnda6O9pOg mwRq/SY5NRv2Ee+6jt7DMeUMStv0Axu/iEp7X8a59UVWW4/Mw6oN8swhC0v4RhIQhXqD Wm0wERrcE2L5zAZOD70PwWGt01CHcxT7gIoWw7em0bnHzw58cjnA1MMulg1rcAYumI2d DWI5uLdu2Yh5TSyzQiLLhNOJOrUUEPbXVwR0SPD7e5vphyVoUKRDwfJTyGk0b9YKSt2I aK9w== X-Gm-Message-State: AOAM530vxAB1Syg/I9LEUmHDJxANU1V1UoF40Y4B3x4N1pPP/6/+f/2w I0cKjahvWK5hdgt4o3+Av82WMQ== X-Google-Smtp-Source: ABdhPJyULYV7uyMKFON0g6QeIUPPVExc6r1kLNMAX6RtpDYT0CR5u/H5Yez5VH1mGjPcTjgVWPC5Ow== X-Received: by 2002:a05:6402:35c2:: with SMTP id z2mr8451744edc.34.1612455411418; Thu, 04 Feb 2021 08:16:51 -0800 (PST) Received: from localhost.localdomain (217-149-171-72.nat.highway.telekom.at. [217.149.171.72]) by smtp.gmail.com with ESMTPSA id j5sm2678288edl.42.2021.02.04.08.16.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Feb 2021 08:16:50 -0800 (PST) Message-ID: Subject: Re: Request for example using pqconnectstart,pqconnectpoll part. From: Laurenz Albe To: Om Prakash Jaiswal , "pgsql-general@postgresql.org" Date: Thu, 04 Feb 2021 17:16:49 +0100 In-Reply-To: <1275164188.2095748.1612452437482@mail.yahoo.com> References: <1275164188.2095748.1612452437482.ref@mail.yahoo.com> <1275164188.2095748.1612452437482@mail.yahoo.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5 (3.36.5-2.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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