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 1wiCTz-00045H-1r for pgsql-hackers@arkaria.postgresql.org; Fri, 10 Jul 2026 14:45:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wiCTy-000jUg-0C for pgsql-hackers@arkaria.postgresql.org; Fri, 10 Jul 2026 14:45:38 +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 1wiCTx-000jUX-2C for pgsql-hackers@lists.postgresql.org; Fri, 10 Jul 2026 14:45:38 +0000 Received: from mail-lf1-x12d.google.com ([2a00:1450:4864:20::12d]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wiCTw-000000002wR-1b1t for pgsql-hackers@postgresql.org; Fri, 10 Jul 2026 14:45:37 +0000 Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-5aec139da7eso1163200e87.1 for ; Fri, 10 Jul 2026 07:45:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1783694733; cv=none; d=google.com; s=arc-20260327; b=VkbIc/jpvm1UesbTg9gY44ZVSA8Ttwu84BD/NhObQtwNLLV7nGxalJ7szbNctpTC1i MeB9bdsZGZjVxDUni4sF/mAeUkb5H5JFM+p0mpBMGiGqbehVp4Mps60O2zCxNSO2qqox a/UxlkPyngff8yqBP5bB0cSmolIYTGDPG7EnMQWrQWIx08vdpis0D5hPvIITrR5/h2yB oMsDy/p5onYlzKi+sA6wl2JeXen6Smy9joXvYc+P/JDBNR1tz7xCCx9jU+GYouW9kI+m /ezLNUpmBXtfIRJs3rOaFuQBSRtzriJ1ewRyY9Rf8p6qZtYUvQdVKdp5Q/mzPCQRjTL6 lPzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=CMN/VJtkgG+qWHdToUQXw7QMcMYbCP02NchMd3aTbkw=; fh=M21qPY32rjfBGfqHy3fvaY0UmfMZtlQRRh6LiSzO/Xo=; b=OcE4cp3H+s1ToBPdQy2zjnsUgMMqUDZgXo610LwtAL8UKh4TqKlFTkhyxbH4y1171G a5uOj5NAaEWkR7uFIgTT7iMxhAuCBVURMAgqhQCRTLHVob4wqvgT2atJ8mZvAFFAn+tx JF87E1LFTIkSZGINuKrKPYI49OmgrDgkwBwuJ8c2H4DYvtebaJ9kDoCqhZRmCxSJ0rFr gO/ZOPOpj34x7uBQ4MSYb2tcIJWdaqoSRM6d9blddpn9rJUsFogUkzPNOF6F46iZFk09 YdrEtEDdnHLBWv75EPmgB57UKaRXTfl787GOr0eZtcqzPqHjb6gxwK7Oou1wLJ+4VpiK b0Yg==; darn=postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=f10-com-br.20251104.gappssmtp.com; s=20251104; t=1783694733; x=1784299533; darn=postgresql.org; h=content-type:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:from:to:cc:subject:date:message-id:reply-to :content-type; bh=CMN/VJtkgG+qWHdToUQXw7QMcMYbCP02NchMd3aTbkw=; b=fG1OKQMvZXaTtSjQ1HouwA/sTrpjTKFuf5aVNGELa2RU8bkQFOv8j7yiUIVDJh1zJo QHV+LqGAVb1xORmF+EDnma9GhzN8aeENnH97IKZCPoX71hs1Kw+2+sD1VzwsYzVxHHCs fPsJFyIq4LYygdSvXSWUHQV3/PQ8PLc0ViNZ03OHu7bSwwB41EGYIGnh3bK9mn3v409Y 1plHE26+oEDiYmta1cdvbM1eq6TmCWaW77C8gVRGY4bXpY6dzB2vq5ah4Z0N2NOtPZYM E26xkSEhGe2W88YHrNX9GjZMCfjE7RLg34h0XWU60ecrwPxEKNVhVAu8Cs0KJmdV1/m+ 00+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783694733; x=1784299533; h=content-type:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to:content-type; bh=CMN/VJtkgG+qWHdToUQXw7QMcMYbCP02NchMd3aTbkw=; b=fnmo1np0psjB+4Y00hrODf/IQqzuFpQSFgqSVrTMQ9PxwGsNMieCibGKUTCZIzTdLT DpNR+YKHW342BS/Pem+FltKkgFOPIDR0QLbelB5LONMkuePaohU0GwuAmJZIrJHmhK4Y 3yNMsDEV0NRnA7/0qaV5Iszsz+F/ctSRez8OCpqN6A36XA5U6DcBPEhiKho/akxP3naK iyDGNKVCQu+jkhwJFfltDq3wcFjo1xfc1HUzYwhrnGDaKpNTxvb97pZy10Iqofd8ANuv fr4Qqus9Nu9Ad6z9SzNHaEHLOB01OW+As8p1Q993zqOUAMUsyX/BcmqjfWpsmJzo4jIA cXUg== X-Gm-Message-State: AOJu0YxN2mQx8yf/jRYBffQCkph/rHatQC6g80/Tg9MeBcCI3gJ4EdAc s/SOXSRAThxHpJPHoFEMH6chCOsNVS5cfghrl8cdau7daZs+w/GjzIoB7PWhPQFqLbF8bCii5JY BqSPBFDefnEQktnefn6W2X9QBLunM1ZkStWZilrMhis9OYrmB4ktuAg== X-Gm-Gg: AfdE7clHCPW+lZBKzlS9hiXcdK7+ixXQghvv0urR987BfYBzaYBC9T4coRGhP+ACW8O Mh/Yl92oiXzElZfNNClEaJ6FIsKdm0omBLYMtFBwlDHNas20TwyEpRewfSXRdbhy+fXPwYvVEew WRZ586ooBafnlu6nA4cSo6xhyolaYeCSnT1poxBU8kWoEXP7UpAFVDo96et522Lw0jVjU0lx9jG OmZCa3TOQ8XJXHzpns3LcTPZdUOjFGxfWvkqlnLrCanE/qRgMujYa2/2EmA8+NsC+b8YCRr X-Received: by 2002:a05:6512:3051:b0:5ae:d72d:1000 with SMTP id 2adb3069b0e04-5b01c3e617dmr789821e87.1.1783694732589; Fri, 10 Jul 2026 07:45:32 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Marcos Pegoraro Date: Fri, 10 Jul 2026 11:44:55 -0300 X-Gm-Features: AUfX_mywI1KEFddZZX_FC4CrTJbzPS8pmpHOTUBdwtkDzrWYnAJWJtRGwbBk-fQ Message-ID: Subject: Re: Proposal: INSERT ... BY NAME To: Ayush Tiwari Cc: PostgreSQL Hackers , Peter Eisentraut Content-Type: multipart/alternative; boundary="000000000000ec8e0f065642cacb" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000ec8e0f065642cacb Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Em sex., 3 de jul. de 2026 =C3=A0s 08:08, Ayush Tiwari < ayushtiwari.slg01@gmail.com> escreveu: > - BY NAME requires a query source and is rejected for VALUES and DEFAUL= T > VALUES. BY POSITION is accepted with DEFAULT VALUES as a no-op. > Is it rejected for VALUES, even if those VALUES are named ? This one should work, doesn't it ? insert into t1 (c1, c2) by name select * from (Values (1,2)) x(c2, c1) And is missing a test for select *, right ? create table a(a int, b int, c int); create table b(b int, c int, a int); insert into a by name select * from b; regards Marcos --000000000000ec8e0f065642cacb Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Em sex., 3 de jul. de 2026 =C3=A0s 08:08, Ayush Tiwari <ayushtiwari.slg01@gmail.com>= escreveu:
= =C2=A0 - BY NAME requires a qu= ery source and is rejected for VALUES and DEFAULT
=C2=A0 = =C2=A0 VALUES.=C2=A0 BY POSITION is accepted with DEFAULT VALUES as a no-op= .
Is it rejected for VALUES= , even if those VALUES are named ?=C2=A0
This one should work, doesn't it ?
i= nsert into t1 (c1, c2) by name select * from (Values (1,2)) x(c2, c1)
=

And is missing a test f= or select *, right ?
create table a(a int, b int, c = int);
create table b(b int, c int, a int);
insert into a by name select * from b;

regards
Marcos
--000000000000ec8e0f065642cacb--