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 1tuTEr-008tE6-DR for pgsql-hackers@arkaria.postgresql.org; Tue, 18 Mar 2025 09:27:58 +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 1tuTEq-00B9o4-3v for pgsql-hackers@arkaria.postgresql.org; Tue, 18 Mar 2025 09:27:56 +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.94.2) (envelope-from ) id 1tuTEp-00B9ns-M1 for pgsql-hackers@lists.postgresql.org; Tue, 18 Mar 2025 09:27:55 +0000 Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tuTEn-003Tu9-1a for pgsql-hackers@postgresql.org; Tue, 18 Mar 2025 09:27:54 +0000 Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-5495c1e1b63so6529902e87.0 for ; Tue, 18 Mar 2025 02:27:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jeltef.nl; s=google; t=1742290072; x=1742894872; 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=WrM5uA9xiz+79o6PMECICp+qidBRfrdDvzSN3csx0VY=; b=LhzQInaLXjxGeF7JjFaJ+TnaGr1n+UR3SPabIXHoeoX7NOhbp7eeYbt0V/YflsGkG0 A7OHXqPuPacfX8lZ2CjYRU1uhgWZFMf+rSsCPjrC0y+v9ioEKrP5L31C2DiikUBIFzW5 cnhyVfTTTUPfCKnAtdhH15q8tlgAeULAMvFLUcmZLPW9m1oFr4z0i4x/sFcWirJ4imOg IdSEbwyK7vHzfCng+UckUj3WjZ52/A4Wpb/9rDMkM3196gkT+Nf7GhyZOYn1kz5rVFpq ZN8g/7Pwt8D4BTm7RxhofEERFAG+MDm85u1Hh6cAR7nDnPOh9GjrjSpCnkMci37BFjZ7 refA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742290072; x=1742894872; 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=WrM5uA9xiz+79o6PMECICp+qidBRfrdDvzSN3csx0VY=; b=bc7DFHJRdPoKfyZx1xtioyD3KV/KoP7fqs70XSNRNLDfH0YVReAk0W3/E2m/PWWmoD YQ6iO/v3mmryTLctCfXxdT4W8wDDLxFfVKF0QJd6plyUqofeCHTj8SaUz9775OljxDxw kvg58t5HuMtpChUMtumdf0ZFrbFZjGki6Np5BYBfhj387gnP1zNGpBUuN56Vhz6jIprh /I4ET28RXVfjDjFq48Z1V9ANt8P4LD01N+79NMqcYLv2JzwWNGzCwlXviE79i8bQRdbi fC/zRhoO79h6n70eRP36HNDENJniaWdCk8FwlAvUgWmPmipGgmemqldxAHZE8AP2Allo bYRA== X-Forwarded-Encrypted: i=1; AJvYcCWx/rjzJfPOmllIxZl6vb7d6DtegNXjqwz3znVK3OZBeGahD//ADp2Kkp/JBZUjL18wiqm1JwYWARXsAyuS@postgresql.org X-Gm-Message-State: AOJu0YzJj/jrHagun2tbmaXmStBIAYtn/0XwjhNryi3mJOt5wbFOsXmi ImMLO8Wu0HgwDxc7+tR329LJCCYwKyag+Tr32zCCFKfENhufrNMMUW9lif9ex2W4Zw0xOCxzGuW a3AT33EW4svYVLzInsWiit6lHKOt2n7aq5r8rcryg5A2iO8zQNlY= X-Gm-Gg: ASbGnctFTRdvraA/lP/WoQ83xyaUhKMHuQMyop8mExykKI75p97XvEBaASDs3Xlze7d ZVqCm81F0lTlZuuSaeXvKmHxA/Muf1c3CuUZfk9zlZ541fadJOtvBU8iQNMcsCG3UCQiKDPY1pj NIxM3V9ObcDY5ck67zjayGr415zic= X-Google-Smtp-Source: AGHT+IEd/k8pI3umOzHmQKWNy4Va+V0caj3Rbp2rE/p/3uta/R7YA6FgCjQdXUNctkbekBqUMr/350+7PCCM5Gu5e0Y= X-Received: by 2002:a05:6512:3e17:b0:549:8cc9:67d1 with SMTP id 2adb3069b0e04-549c3989ad4mr9498711e87.38.1742290070999; Tue, 18 Mar 2025 02:27:50 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Jelte Fennema-Nio Date: Tue, 18 Mar 2025 10:27:38 +0100 X-Gm-Features: AQ5f1JoNVzLdF0jIQ7wrNHA1rDjIHlbNmHV59hN9zR6eCVUk8fXiTUNaUJ0SVHM Message-ID: Subject: Re: Add Pipelining support in psql To: Anthonin Bonnefoy Cc: Michael Paquier , Daniel Verite , 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 Tue, 18 Mar 2025 at 09:55, Anthonin Bonnefoy wrote: > I've added additional tests when piping queries with ';': > - I've reused the same scenario with \sendpipeline: single query, > multiple queries, flushes, syncs, using COPY... > - Using ';' will replace the unnamed prepared statement. It's a bit > different from expected as a simple query will delete the unnamed > prepared statement. > - Sending an extended query prepared with \bind using a ';' on a > newline, though this is not specific to pipelining. The scanned > semicolon triggers the call to SendQuery, processing the buffered > extended query. It's a bit unusual but that's the current behaviour. One thing that comes to mind that I think would be quite useful and pretty easy to implement if we have this functionality within a pipeline: An \extended command. That puts psql in "extended protocol mode" (without enabling pipelining). In "extended protocol mode" all queries would automatically be sent using PQsendQueryParams. That would remove the need to use \bind anymore outside of a pipeline either.