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 1whM8l-000Amj-1n for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Jul 2026 06:52:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1whM8i-0059t3-2V for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Jul 2026 06:52:13 +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 1whM8i-0059sv-1Z for pgsql-hackers@lists.postgresql.org; Wed, 08 Jul 2026 06:52:13 +0000 Received: from mail-qt1-x82b.google.com ([2607:f8b0:4864:20::82b]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1whM8h-000000006xM-1Adj for pgsql-hackers@postgresql.org; Wed, 08 Jul 2026 06:52:12 +0000 Received: by mail-qt1-x82b.google.com with SMTP id d75a77b69052e-51c0c68aa31so1780851cf.3 for ; Tue, 07 Jul 2026 23:52:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1783493531; cv=none; d=google.com; s=arc-20260327; b=gVSR8NjlTyw9tU4DOvbKT4GdhTISdWI011AqeO8PEjvGXiwcrgdI6/spz3JCuYk3rO QlLeAdZahoOmqgaYwwbveKothOC+gdJEC6KNsBL7JPTGNUuE6KPks1jBRJUUiFKx4BYC hWHGSkD1nJ81xf5WiGRxWDz6BsXbkd54Fcx+62m1gdYCFk5oOgk/aXmrgeqSyOmjXwdI aTCI5difREcaeJfaHcdyQpgkRsfnGKaSMGrQNJkgQ3g7jONKKFO/p7/nv5dwIOvCAnWC GLgvpg0VFNnm2e8pnojkb+1eo6er+frNUIbd56ISIwNixLYecb1drTAcAH/1XlrVZddU tnQg== 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=lOO5HnjjxuyFLcGOVp1dH2dMCDpwFCOfcyIhritQoVM=; fh=M21qPY32rjfBGfqHy3fvaY0UmfMZtlQRRh6LiSzO/Xo=; b=rsL9Xo9di253Oyy2dlbE3AjJR2dRE+l3XAomu1cZ52Av8XTfPntDwNghxMMtYZ3St1 dIXZDhlM7zXNTvkfDSpWcM3/+6q8PCNhI+9E2tfc+ipREThLibP5X6f4J0UjVWmYae8Q dcBOX4u7fSq4IQnLSNhePF0Iw23mRRaTwSEXpbXJ7gWZgLyOl5t0CZOYEDC+qa6Z0ogA KEwFUhhaTWHAWVENKnyoy16HykTx92jK8HY/2OhZvmd4ogG0d0G7L8/hbUyJGwpbgO7e ZvIaPwEFNJ9AUgqqSIX++8LfQGioKvHDsrQRT+XQywr9pYJZZI+o3hu0FSi0OJRqvO0N zQkw==; darn=postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783493531; x=1784098331; 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=lOO5HnjjxuyFLcGOVp1dH2dMCDpwFCOfcyIhritQoVM=; b=A0TeFP0Mn8tSA1LtfYHsS74rB4BBGnkU4/Jh0CRPO6UZBqZ4cXu7qCqzKidHkzuCe1 xNgQjyfjWlfEjeanwHjz8EdQHWj7PUHW/zWL6uVuzKqiJBJyoo/QQtdfuhUeLHHV417t 2zc8jleUqLEGAhLekGt1zMScvSdR/d8zoDp8XG0TUBun6PHsx/QfCXnI9DPWoRn1bLDs M4mSH5FV/LGinp/+0eabB9Zn/xICVj6PqB1q150orVQMUq6HkFkDuosufzlBKeCYOAj+ 9l+638m+UQWckPkg6Y/xghNbJ8NPwHTctxlexzqRCBc/GBk1E7KlX9A/iErj53SgjLt2 wdbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783493531; x=1784098331; 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=lOO5HnjjxuyFLcGOVp1dH2dMCDpwFCOfcyIhritQoVM=; b=EHVOMeB5pgdBGk758W+IFZwAPVOYdDUvoU4439f2WI0bzwfF/BlmAs0YPtwFbaL+r9 Jz2VSYPvuM8F6ukroImR44NdK9YT0E1W/9vHNi5/vnQft6Ree37AwI/dUQehvak5CyTk 3plJgg4F64EsDL4invT0sxaO+a9uH2QYP3HKJpP+QwMYikR1QM53BjX9X8d2idavwBTm iMVKsPC7zqv+ntG9Rdzf4w0qzx+lR/0Fc5aHMb0Jec2oHLO/cKipsHMQJhVvTO8Ytj1M lMxuH8n+mOCKSYn+Wu9REylk6knB1Lc7AAo0AD5jSL5HJ+hxsPYeBR8i2McUI4+DnC9X cz7g== X-Gm-Message-State: AOJu0Ywtjl7Ag2+X2Hjw9PbeFWJWAz4USiJmIwWCmy6QHeA+SfAWjXla YP3gMMBAMKI2OpVgDoppm31TWGTPT4YcBvhclFQbPalDqet0FZ+P616q3HgSD1Dd1gUniT+h+O6 A0FTmGQOB7qLzFIQO0uSiYunbSd04WFI= X-Gm-Gg: AfdE7cmgtGzo+wj7swjvyfKFb+1KJT+xMV9y7nIMedLhNOO1lyAgbMRZWLfK40ANBIB 1iJk751NxMpLXgapwcGExVWWzXAWMXlGHYAfDVtOOVwYYM1nt0Z8/9wLrDfxzav4+b892irg0iG zowYUqWYFY+FYMzkTYn8UM916aTH9vLv2wSWPlzKvxZhX8rWQGh1CPD97FUcHlPqqbau1f/vB46 woZIfRpQ/8sGU9KIA3ulWX7VYmZyMcWvrM6EB7VhK6NHKtWBlSatDTOqiOJRWGWgXjK4ZxH X-Received: by 2002:a05:622a:d2:b0:51c:7b12:5ffb with SMTP id d75a77b69052e-51c8b4406e2mr14551621cf.87.1783493530790; Tue, 07 Jul 2026 23:52:10 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: solai v Date: Wed, 8 Jul 2026 12:22:28 +0530 X-Gm-Features: AVVi8CcwDZ1ojPATUCicr0xqsnJ1LQ4-OYp06rENFS7SdVFolpCBkoF1AKQMRaQ Message-ID: Subject: Re: Proposal: INSERT ... BY NAME To: Ayush Tiwari Cc: PostgreSQL Hackers , Peter Eisentraut Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi Ayush, I tested the patch and the feature worked as expected in my testing. Before applying the patch, INSERT ... BY NAME resulted in a syntax error because PostgreSQL only supports positional matching. After applying the patch, the same query executed successfully and the source columns were matched to the target columns by their names, even when the SELECT list was in a different order. I also tried a case where the SELECT list reordered columns with different data types (age, id, name). Without BY NAME, PostgreSQL attempted positional insertion and failed with a type mismatch error. With BY NAME, the columns were correctly matched by name and the row was inserted successfully.