Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wcEFw-003BeE-2M for pgsql-hackers@arkaria.postgresql.org; Wed, 24 Jun 2026 03:26:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wcEFt-00F3io-2u for pgsql-hackers@arkaria.postgresql.org; Wed, 24 Jun 2026 03:26:25 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wcEFt-00F3ig-1S for pgsql-hackers@lists.postgresql.org; Wed, 24 Jun 2026 03:26:25 +0000 Received: from mail.postgrespro.ru ([93.174.132.70]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wcEFq-00000001qJX-2Tee for pgsql-hackers@lists.postgresql.org; Wed, 24 Jun 2026 03:26:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mx2023; t=1782271575; bh=SPqdE2JL3onolhYwJ3SUm6Vf+bfCFmCjH7ur6loCUbM=; h=Message-ID:Date:User-Agent:Subject:To:Cc:References:From: In-Reply-To:From; b=Q3ai4L1SiuBxpS9XjxTdUXzyhSw4/ziE4D8cUs8H6gsFd95DG5kG2jQALERP+NZ1o uvYGtVoBcyl6ZJiTXadeoYvhnVUSpSp+hb5i/RhumvWE9VPxFye91KXPDfFIYYiRQs hniH3m/omkqCp4RmAw04m4Bq3VLWqPzQi/uK0Ud+yZmuQqhZN7evVYNgE1gLD2EWCX ft+fdbJrYnr57rQ1FoEh212vXk036Kwsy/sAw3bk/QSY+uU7Kd1sJcCeiFfHhq+9LV 37t1uK9Xo1Qay4Aba/+SYIxyl0yw05Ziy12XwGx3xSQaPfKXWskpADqKJvJvZZHZtM s4tfKUu03aV5Q== Received: from [172.30.48.130] (debian11-template.l.postgrespro.ru [192.168.2.254]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: d.bondar@postgrespro.ru) by mail.postgrespro.ru (Postfix/465) with ESMTPSA id CE23960B80; Wed, 24 Jun 2026 06:26:14 +0300 (MSK) Message-ID: <3f24365a-c440-47de-88cf-7ee7cd02c7dd@postgrespro.ru> Date: Wed, 24 Jun 2026 10:26:14 +0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Pgbench: remove synchronous prepare To: Robert Haas Cc: pgsql-hackers@lists.postgresql.org References: <2da56b59-acb6-4ee3-af6b-6e800115dc7f@postgrespro.ru> <6e161344-d26a-4e3d-aa12-83a05a3ca8dc@postgrespro.ru> <6cf1ae29-0992-4a14-a52f-b769b560b92a@postgrespro.ru> Content-Language: en-US From: Dmitrii Bondar In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-KSMG-AntiPhishing: NotDetected X-KSMG-AntiSpam-Interceptor-Info: not scanned X-KSMG-AntiSpam-Status: not scanned, disabled by settings X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 3.0.0.9059, bases: 2026/06/23 22:47:00 #28275891 X-KSMG-AntiVirus-Status: NotDetected, skipped X-KSMG-LinksScanning: not scanned, disabled by settings X-KSMG-Message-Action: skipped X-KSMG-Rule-ID: 1 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 5/27/26 7:39 PM, Robert Haas wrote: > On Tue, May 5, 2026 at 3:48 AM Dmitrii Bondar wrote: > [ Catching up after pgconf.dev ] > > ... there should be a solution possible by > using the non-blocking variant of the same function (which in this > case is PQsendPrepare). If using that causes pgbench to die with some > weird error, that seems like a sign that other parts of pgbench also > need a bit of adjustment, rather than a sign that we need a new libpq > entrypoint. > You are right that there is another solution, but it requires changes in other parts of pgbench. As I mentioned in my previous message, using PQsendPrepare is absolutely possible, but it would require changes to the pgbench state machine. In particular, a new state would be needed to wait asynchronously for the response to a Prepare message. The only reason I have not done that is that it would require rewriting code in several places, whereas adding a new libpq entry would mostly extend the code rather than modify the existing logic.