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 1m1UX9-0001f7-J2 for pgsql-hackers@arkaria.postgresql.org; Thu, 08 Jul 2021 13:57:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m1UX7-0007K2-6n for pgsql-hackers@arkaria.postgresql.org; Thu, 08 Jul 2021 13:57:41 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m1UX6-0007Ju-Rx for pgsql-hackers@lists.postgresql.org; Thu, 08 Jul 2021 13:57:40 +0000 Received: from mail-pg1-x533.google.com ([2607:f8b0:4864:20::533]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1m1UX3-0006DB-4j for pgsql-hackers@lists.postgresql.org; Thu, 08 Jul 2021 13:57:39 +0000 Received: by mail-pg1-x533.google.com with SMTP id 62so6074511pgf.1 for ; Thu, 08 Jul 2021 06:57:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to; bh=YszzG8EmKJgqRHLw4+MUTKYyGWHiClHHjL1AM7mKbDM=; b=a5279Gi/VU/NhJLboVJpLpMEAcHPAUYDuOmWewwZPWlxol+UHfXDtBeTSHdSwiQ/q8 p/Yy8Lz5xrpydtzeIrxFX/scxR72VvKBBtyoP9TkP57/BjHjdhJTPs4AylMeq9Pc1UYf unCLpbZGMGmqZ5v//ZttJN9reMJh3X+g6cmr0K2ZfiG0bGuzAnVnzWwrCRLLDScrtWDe SJbcNqqUsqZzkkhBPiraxHSOIBkHL6Al2R1bfyWWfigIhAmD5VabWttFEZJ3aM7fO8r5 IJfMzX6qCtkrQ9efXE0d5tN03My+uKu5iMZRDrhFaG4WxZSFdvsEH5xKscFXqAYii+cx JWMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=YszzG8EmKJgqRHLw4+MUTKYyGWHiClHHjL1AM7mKbDM=; b=GgCVQfDc1Teu7hrguMqSWx+lfBtKQdbbx//HLAElMt85n7rOin7rFRgIpHk5xf71Cf ZW60wg8ET5h21wKwdPdtDoW/Ro/KeqoSD8QFc5DKf8t7egK6gv46/2Fk2IjsIvVowwXQ UnFLpuYKElA7T5Zis0h2n5VzW8A9WvRGODPqMMm61f/fq/BlereeaERDoF58OC/DpU5E gq7C+hajOzQrcz1LS1C/euNki8suT2o2qi2A2L6jaAEjW8NaGMyJKFlRcSWsB3rRLPnN ZDuA4MH37AC2Do8quL2Mc1T8PDwMqymzpQZ5sWm6UjrEfHAxfZpHhB0laJllYBJrywQJ u87A== X-Gm-Message-State: AOAM533Wqhb7y62YmKl7IeQuML4wuGX4zjy8Y5HVjF3CxpnzhSGhNBo2 mJFk0SttQ1uy5zdT2e0e5k8ftnOt9eOQPw== X-Google-Smtp-Source: ABdhPJw/ZmcF7zbsJaiYbnxUbO89s4+WdhoDdBVJSdGkkUg3wrMOjhsSpVQtWMCFoNtok3qCE67csQ== X-Received: by 2002:a63:5210:: with SMTP id g16mr15730363pgb.217.1625752655703; Thu, 08 Jul 2021 06:57:35 -0700 (PDT) Received: from perhan.alvh.no-ip.org ([190.95.19.95]) by smtp.gmail.com with ESMTPSA id v3sm2964762pfm.198.2021.07.08.06.57.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Jul 2021 06:57:34 -0700 (PDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id E5F4D2A66A2; Thu, 8 Jul 2021 09:57:32 -0400 (-04) Date: Thu, 8 Jul 2021 09:57:32 -0400 From: Alvaro Herrera To: Boris Kolpackov Cc: pgsql-hackers@lists.postgresql.org, Michael Paquier , Andrew Dunstan , Peter Geoghegan Subject: Re: Pipeline mode and PQpipelineSync() Message-ID: <202107081357.xbplnti7szms@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2021-Jul-08, Boris Kolpackov wrote: > Alvaro Herrera writes: > > > Hmm ... aren't you trying to read more results than you sent queries? > > Hm, but should I be able to? Or, to put another way, should PQisBusy() > indicate there is a result available without me sending a query for it? > That sounds very counter-intuitive to me. That seems a fair complaint, but I think PQisBusy is doing the right thing per its charter. It is documented as "would PQgetResult block?" and it is returning correctly that PQgetResult would not block in that situation, because no queries are pending. I think we would regret changing PQisBusy in the way you suggest. I think your expectation is that we would have an entry point for easy iteration; a way to say "if there's a result set to be had, can I have it please, otherwise I'm done iterating". That seems a reasonable ask, but PQisBusy is not that. Maybe it would be PQisResultPending() or something like that. I again have to ask the RMT what do they think of adding such a thing to libpq this late in the cycle. -- Álvaro Herrera 39°49'30"S 73°17'W — https://www.EnterpriseDB.com/