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 1w5uXN-003kUj-1k for pgsql-hackers@arkaria.postgresql.org; Thu, 26 Mar 2026 23:54:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w5uXL-006cJ2-31 for pgsql-hackers@arkaria.postgresql.org; Thu, 26 Mar 2026 23:54:52 +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.96) (envelope-from ) id 1w5uXL-006cIu-20 for pgsql-hackers@lists.postgresql.org; Thu, 26 Mar 2026 23:54:52 +0000 Received: from mail-oo1-xc2b.google.com ([2607:f8b0:4864:20::c2b]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w5uXJ-00000001NaZ-2TZg for pgsql-hackers@postgresql.org; Thu, 26 Mar 2026 23:54:51 +0000 Received: by mail-oo1-xc2b.google.com with SMTP id 006d021491bc7-66f3e7d9eccso900853eaf.1 for ; Thu, 26 Mar 2026 16:54:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1774569288; cv=none; d=google.com; s=arc-20240605; b=RMreOYZWFdhMjD4AOKw8lmqWOExHLt6/gTS5Sw/ezMTmXIUzfQRYiXKZQ2U9yy0wM4 TrUZL/Lgob+0DNgXJV7Ls3+8SIfCttBO1+AiNRtLm8YrqKwLs/cq99AeNGCQ06s12/Md kCC3ItkmJRw/ZgcPQrD2thpZRkIjKYZFoYfLGrifxRkDOgVw3FbJ4oA8GE3G2ob07rTr I7yievcTC0VUD2N7qx+O5NkMthGi6Kz3kE6dIUL844etXHqU9VETUwjpiTphKE08e8Hn s+MH8AS3HDOD6JcZmhrB4Pi4VKmWM+MtUCYSUD/UUmZE5N3uzv/9cquG/n2M1oGCNJTp zm/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=LNTs8p+dqm19HKzOrZNyLYW9osOQml8h5n52mj3dIMQ=; fh=TsloTcX2nBTeHlhx+EbW+aQ847CeSGXCLbRNXLs6cd4=; b=VbpVputP1x4xNgFgC5HGEOn4srZRbC0iektRhV2igdDaHWT5YFqAznIbFzIlDSauwy irTd6Oo71RWMmi/X1fP4umcOyEp4UPXxHIb1+2ugrRzsKxI3m8OLNH2p3EOUad67CqTe 98PZ79mNVr+TRWAkE8/cuZMV3LcFwJfK/5kHBCar3iXSb+ivIFAAp1i45w+VZRtduPyw 0z+dQWaUygAgipzEfkDwgAZs90g560wMRPJnnvnIrMwaCdoeEbQG+pPOdXSe49Go2RGH kupnhuZQLb5v7xOS/FbDlV442m5yD6Ej42qMpaFve//QiMGRLRE/K3rbw1BwTp3edK9J oa1A==; 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=1774569288; x=1775174088; 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=LNTs8p+dqm19HKzOrZNyLYW9osOQml8h5n52mj3dIMQ=; b=U5wiwMLqpn7XxC7TNputuexhoDxqxsmfvlFVbGPr+NUHYnKj2cBfLS9uXyJKUo5iFf hKDTk307quJFoAFomsCf1VqsD5Ael6CbmLQmILTpUxVQoR5VDT31jORsbI0JScEmZiy/ a/UDWmxu/oMwn0cQfzA980pOl/Ss4Q4JhNTZWwn1xhiKVXJcJhV3KhYpWjrE3cTLTe1G ZSqFJZeZh19Qwq/euqDl6vvUtL1/RP6wPGXnyf9okYJH/qWkJKI1yb/lgyNzkUYLysjX zPn/x/K1kyrWYlp+ldVM7kd2lyjEbuTp1P3UZmeTRm3dH0k8dncRihQSwBE/YDQFIj7R P/LA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774569288; x=1775174088; h=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; bh=LNTs8p+dqm19HKzOrZNyLYW9osOQml8h5n52mj3dIMQ=; b=DiMZ7viWmw6CKeH/Cw5GjbpgHlR+yt5l/liczV1LT8c+SQjpno6HS0TepXdvvddfNR Cr2gaWoSGgsq3uee1ix+K1R2m8vnWNk99g05dRiV+OUatS/JvZL8PnKpJQjJpdakLW8m S7EVgUXMc6WpMSG3aVFBbmU/DwW7W8mHWg76NKfQl97c2iMUK/iG5RiqxD1rOUglX/6S skoUb+dRpZPG03fWyhSw5WmWKRs06DQC7R6gVWD2u9XduEgJQLOMmq7HhNlD7lAPCKDC DWoxiPj2RQjh7NUoswqzlR9ePrFnu0bFniavOo3B2fZlJVTxjaE16BjD0xYPGoR2X7xQ +fng== X-Forwarded-Encrypted: i=1; AJvYcCUXDaJtx+jN48RhT93pcxi+UVObVfGeJa8BdeLlETfAntTDcy22TPu/L9cPIwyLIofG7p6PbJzS5+9/2q/J@postgresql.org X-Gm-Message-State: AOJu0YybguheG7Y6IQNTnUVtX9yKGPurpjoPmQH4YqV1M7MNrXsj8aL9 lrbsC7l0D1SkjAaQ1L+tSV0iM+6aVNbAHmrppbcoVma4IcvhVk9W0wOa7SJ8kN96lgadRCCjl5Z LXAsbwShoYKpS5eKnV3DpzY+vczR4AbQ= X-Gm-Gg: ATEYQzyG0/4/V+dE2u3CFAi6KaOeaOojmZRF1RpyKZRe7tT2HSXAVBgb33wYLJNNcFJ XGzf0d/kV6o6pVcInWVxzlhDFrsdWI1boBIKweFB3ZBKVjt7cdKniDZUiXdz9AYEVH0wboPSu21 75JM71Td587M1sZKgazcdrvewQAXoIrE5dSSG59QiqmzkKFNJyWG3u7Ylc9zmJBiZ/M3BfzIkcQ sqzQfMpd29y+Gj4S17ji9WGl6G5r2K8FndnaYr34adCnGgJKa1l3twFON07qdgGF7z+AHkd52Up 7VfmshM/eEPrj9UbE9H0o3CSMwDpguPBlUH+Wmw= X-Received: by 2002:a4a:e90c:0:b0:67d:eb47:8dc7 with SMTP id 006d021491bc7-67e18730885mr288663eaf.49.1774569288260; Thu, 26 Mar 2026 16:54:48 -0700 (PDT) MIME-Version: 1.0 References: <202603262322.jvxx26ed3eu5@alvherre.pgsql> In-Reply-To: <202603262322.jvxx26ed3eu5@alvherre.pgsql> From: "David G. Johnston" Date: Thu, 26 Mar 2026 16:54:12 -0700 X-Gm-Features: AQROBzC2WlxX9n-rOM7l-gYP-S1MZbBvvAr8pKQmzUzaxbQN4nLmkmHBVe_mn2M Message-ID: Subject: Re: [PATCH v1] Replace sprintf() with snprintf() in libpq for safety Anexo: o arquivo To: =?UTF-8?Q?=C3=81lvaro_Herrera?= Cc: Thiago Caserta , "pgsql-hackers@postgresql.org" Content-Type: multipart/alternative; boundary="0000000000000e621c064df61c56" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000000e621c064df61c56 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Mar 26, 2026 at 4:33=E2=80=AFPM =C3=81lvaro Herrera wrote: > On 2026-Mar-24, Thiago Caserta wrote: > > > Attached is a patch that converts several sprintf() calls to > > snprintf() in libpq client library code. > > I'm not sure we should take a patch with a tag attributing authorship to > an LLM owned by a commercial entity. Agreed. As with a book author, any bad code, decisions, or other mistakes are solely the fault of the submitting author. As is the good stuff. Ideally the author has confirmed it is good (in their own opinion) since they expect others to do so as well as part of the review and commit process. It is in fact a reputational thing for authors to take full ownership of what they submit. > Do we really want to be accepting code patches written by tools that > make the most obvious code worse than before? I am quite scared of the > quality of code of medium complexity written by this tool. > > I'd say take this as an opportunity to teach (or not) just as if the author of patch claimed to write the entire thing without AI assistance. But it would definitely be reasonable for a hastily produced patch that doesn't pass muster to be hastily rejected on such grounds. We have plenty to review and if this patch wouldn't have existed without LLM assistance then unless it sparks the interest in someone to go and clean it up anyway we are not really any worse off being quick to state that it doesn't meet our standards. Otherwise, while there is a patch, maybe just treat it as a simple suggestion with an example. David J. --0000000000000e621c064df61c56 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Thu, Mar 26, 2026 at 4:33=E2=80=AFPM =C3=81lvaro Herrer= a <alvherre@kurilemu.de> = wrote:
<= blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-l= eft:1px solid rgb(204,204,204);padding-left:1ex">On 2026-Mar-24, Thiago Cas= erta wrote:

> Attached is a patch that converts several sprintf() calls to
> snprintf() in libpq client library code.

I'm not sure we should take a patch with a tag attributing authorship t= o
an LLM owned by a commercial entity.

Agr= eed.=C2=A0 As with a book author, any bad code, decisions, or other mistake= s are solely the fault of the submitting author.=C2=A0 As is the good stuff= .=C2=A0 Ideally the author has confirmed it is good (in their own opinion) = since they expect others to do so as well as part of the review and commit = process.

It is in fact a reputational thing for = authors to take full ownership of what they submit.


Do we really want to be accepting code patches written by tools that
make the most obvious code worse than before?=C2=A0 I am quite scared of th= e
quality of code of medium complexity written by this tool.


I'd say take this as an opportunity=C2=A0to teach= (or not) just as if the author of patch claimed to write the entire thing = without AI assistance.=C2=A0 But it would definitely be reasonable for a ha= stily produced patch that doesn't pass muster to be hastily rejected on= such grounds.=C2=A0 We have plenty to review and if this patch wouldn'= t have existed without LLM assistance then unless it sparks the interest in= someone to go and clean it up anyway we are not really any worse off being= quick to state that it doesn't meet our standards.

<= div class=3D"gmail_default" style=3D"font-family:arial,helvetica,sans-serif= ">Otherwise, while there is a patch, maybe=C2=A0just treat it as a simple s= uggestion with an example.

David J.

=
--0000000000000e621c064df61c56--