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 1m1YZ7-0002qe-F2 for pgsql-hackers@arkaria.postgresql.org; Thu, 08 Jul 2021 18:16:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m1YZ6-00041M-BF for pgsql-hackers@arkaria.postgresql.org; Thu, 08 Jul 2021 18:16:00 +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 1m1YZ6-00041E-30 for pgsql-hackers@lists.postgresql.org; Thu, 08 Jul 2021 18:16:00 +0000 Received: from mail-pg1-x52f.google.com ([2607:f8b0:4864:20::52f]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1m1YZ0-00005r-3j for pgsql-hackers@lists.postgresql.org; Thu, 08 Jul 2021 18:15:59 +0000 Received: by mail-pg1-x52f.google.com with SMTP id 62so7096262pgf.1 for ; Thu, 08 Jul 2021 11:15:53 -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=5Cg23xmdBx72PlDO6zGlW6ICoNkBc7DaKN2FApkzujQ=; b=yAI8FAHHZKFblnHJrWeCF+Do97prVFBSb/ksXVReaAiUnERmpYzpsX+qZPLB2qTKLi LnagwV68vD+kPovq+BCeg8r93azgWB5SSRt460fEMMvId3+jgPAdijePQMJTZIai/6sA 1z5OjNiAnqGMHLyaPIFvWxRlBTuWyTYp3bP6qlYd02fUxaLOpYVZJ8+M8JxkLWql9HA/ uKwVoWWJ/eQBbaS7Emx3XCmENDqsz+Ue5daWqxqdeBQPISB+5Ibo27KKU57ZieNBq0zt PBwQ/I3sx9AcvRUkN5U3mrG+uJkihLDC1aUaQnojpkWKXxOC64r44JbbUndEf6bezXTA nduQ== 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=5Cg23xmdBx72PlDO6zGlW6ICoNkBc7DaKN2FApkzujQ=; b=LdGTGxEQSYoZ1LFcBy6CdBIuPpOfVkyyDbCcT7EMBFMN+6SpZBin+HvYuSPK1evQSr Ieuymh2c+jCApZpXE6awMMhbY1ppIeyu2rd7KYq9jMyZ78wvWXa/MkbUzx+HMmtNtUce BKxiGf63nCd6gFPOSzCQAzESJ+qn9UbKMNlf4CvTrMII0mot/N/WYq0DtCG0aYOI8ffX mAH39Na1KwIa4K3k+DJ/cGVN1tOi9Ncnzz9sY07MsycTuWTRrAi0WOW3BTcxAafZJLMs oqcQ/6BKUHF1klhywIKnV2/qs41EjzvFTzIq1K5Sj6R2EbKTMOVwyNp7MeBQ4zfur+5q R3PA== X-Gm-Message-State: AOAM533eVHW4p3FVeITaPTVlF04FGjb+qI3GS8NlRbUKhLFtT8W+lGVM hcCBQIltMS5hiCVpVIZUPbPBMw== X-Google-Smtp-Source: ABdhPJwfTBubzfoEAhiCMU3UFz+tHsCaaI5o5KkHfx/iUvDD9GWMmQurgD2g5sOUhH8SRE3lTD75Hg== X-Received: by 2002:a63:230c:: with SMTP id j12mr33070152pgj.382.1625768152955; Thu, 08 Jul 2021 11:15:52 -0700 (PDT) Received: from perhan.alvh.no-ip.org ([190.95.19.95]) by smtp.gmail.com with ESMTPSA id 1sm3404909pfm.123.2021.07.08.11.15.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Jul 2021 11:15:52 -0700 (PDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id E29642A0999; Thu, 8 Jul 2021 14:15:49 -0400 (-04) Date: Thu, 8 Jul 2021 14:15:49 -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: <202107081815.ne6nsoeox32x@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <202107081729.osyyji4ewzjk@alvherre.pgsql> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Looking at this again, I noticed that I could probably do away with the switch on pipelineStatus, and just call pqPipelineProcessQueue in all cases when appending commands to the queue; I *think* that will do the right thing in all cases. *Except* that I don't know what will happen if the program is in the middle of processing a result in single-row mode, and then sends another query: that would wipe out the pending results of the query being processed ... but maybe that problem can already occur in some other way. I'll have to write some more tests in libpq_pipeline to verify this. -- Álvaro Herrera Valdivia, Chile — https://www.EnterpriseDB.com/ "Java is clearly an example of money oriented programming" (A. Stepanov)