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.94.2) (envelope-from ) id 1tGFZN-001mxo-KA for pgsql-hackers@arkaria.postgresql.org; Wed, 27 Nov 2024 10:46:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tGFZL-00DmwV-Tf for pgsql-hackers@arkaria.postgresql.org; Wed, 27 Nov 2024 10:46:51 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tGFZL-00DmwN-H1 for pgsql-hackers@lists.postgresql.org; Wed, 27 Nov 2024 10:46:51 +0000 Received: from mail-lj1-x234.google.com ([2a00:1450:4864:20::234]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1tGFZI-004J9y-Ex for pgsql-hackers@postgresql.org; Wed, 27 Nov 2024 10:46:50 +0000 Received: by mail-lj1-x234.google.com with SMTP id 38308e7fff4ca-2ffb3cbcbe4so43898211fa.0 for ; Wed, 27 Nov 2024 02:46:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732704408; x=1733309208; darn=postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=MEer8eFBvbAFDCZeHfmd93lX0lftsho/dciTF3ouJVM=; b=WApn5eOynGjHvSw4t3yLGdvuKKtWIA6t/l2ilCBo50Zh1vSTC9Z0CkM0xQ04RY0RCV hoG/NPNDb0ASocQwTCOLBQWDeFrWl5csRmLuXp/7Jv/A7SHr6IxF2VYOp/OGZWFJn+TY Ki6pvwZoKIXTHyGuscK2KA39+qMMuYOl/0SWqN3U3jzVL0D+eTUkToNUAWWaPisNaSl+ WGvv1C/S6ZiwjpEpGJGSj2yJ1fQ3MPtmK6uib4NZb3XjmcXnkcJiiF/01TkPQhKZzYc/ cPxfTuZF1Azj5nuObo7j/VJMhZjIzlre8cJTBOes2DYE+/eHPat2c0Qm0zArAAWLrMhf IPsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732704408; x=1733309208; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=MEer8eFBvbAFDCZeHfmd93lX0lftsho/dciTF3ouJVM=; b=l99JA7vH9TEoJ6vkQYdUJxit3oE23DYqX+88xeVdOgf6MBoxQK7EBJHPLt9N1uihtF 2qu3ngM0V6tlm2sI5eNeJOMcri+wfaGVWEjydOSbc1P5rgfX4n0Sc82g1c9ml47/x30L +tKTsqpKLYlrXcO+99DVPAZ3+zPYIi503wE4Dg3NWHFVGDPdl6AxhnWS5RZHjag1Sf2Z bxmmsO4Hk2XqC1JNQdDHR0JZ2FfzWZO0JO7V1kIooUeuUzsgN/KLmD6lxUoM50lj31zn 4fhtJMjKsCNdRcdM3AE8bXgIPa2Aj1eYQpcJAnJ0zSDIJg89IC2C/oOjtY2p89W2Tgx2 4yEg== X-Gm-Message-State: AOJu0YwmShxHTh8g9Zl3FMYKXcFIRiBuU64a0jlo/nRKBkhxuFf3xd/8 tvB9hwvp7O4pOMdAYf/V8dAFa3Mj0mkAyyetWue4NVktX8TYd+ZRStzKeBconDk+CJhp6bgx7XJ EQ62emObGZ0Ver21uKFeHUCz55Cw= X-Gm-Gg: ASbGncuDfip3b9P1j2GRZPSuMg38uMCl8A/tkwHqzO4KYt3l3xSk2KkZKO1hhy+HUHI F/1FnTv1sGDGI1zBPCN5v30duWpxHeDpGaqBh5jIDF7msmQ== X-Google-Smtp-Source: AGHT+IG+vT1EM5yy2CF+J54NKoMZfvcXRm9arMGn/Dsk3UnlnJUiYEREse0/c1q5c3wKNLXkX0Y0gAkVq5v0r2jzQAI= X-Received: by 2002:a05:651c:546:b0:2fb:6181:8ca1 with SMTP id 38308e7fff4ca-2ffd5ff56d2mr11742851fa.6.1732704407471; Wed, 27 Nov 2024 02:46:47 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Kirill Reshke Date: Wed, 27 Nov 2024 15:46:36 +0500 Message-ID: Subject: Re: Add Pipelining support in psql To: Anthonin Bonnefoy Cc: PostgreSQL Hackers Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, 27 Nov 2024 at 14:50, Anthonin Bonnefoy wrote: > > Hi, > > With \bind, \parse, \bind_named and \close, it is possible to issue > queries from psql using the extended protocol. However, it wasn't > possible to send those queries using pipelining and the only way to > test pipelined queries was through pgbench's tap tests. Hello, good concept. Our connection pooler testing will greatly benefit from this feature. At the moment, our tests are golang-based and build pipelines in extended proto and verify the outcome. Regression tests based on SQL will be far more thorough and organic. > The attached patch adds pipelining support to psql with 3 new > meta-commands, mirroring what's already done in pgbench: > - \startpipeline starts a new pipeline. All extended queries will be > queued until the end of the pipeline is reached. > - \endpipeline ends an ongoing pipeline. All queued commands will be > sent to the server and all responses will be processed by the psql. > - \syncpipeline queue a synchronisation point without flushing the > commands to the server I'm very doubtful about the \syncpipeline . Maybe we should instead support \sync meta-command in psql? This will be a useful contribution itself. > Those meta-commands will allow testing pipelined query behaviour using > psql regression tests. > > Regards, > Anthonin I haven't looked into the patch in detail yet. -- Best regards, Kirill Reshke