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.98.2) (envelope-from ) id 1xCO6d-00000003lfV-1msp for pgsql-hackers@arkaria.postgresql.org; Thu, 01 Oct 2026 21:14:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1xCO6b-00000008pde-1xkl for pgsql-hackers@arkaria.postgresql.org; Thu, 01 Oct 2026 21:14:17 +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.98.2) (envelope-from ) id 1xCO6b-00000008pdV-0bu7 for pgsql-hackers@lists.postgresql.org; Thu, 01 Oct 2026 21:14:17 +0000 Received: from mail-ej2-x0f.google.com ([2a00:1450:4864:34::f]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1xCO6Z-00000002FxR-1sEi for pgsql-hackers@lists.postgresql.org; Thu, 01 Oct 2026 21:14:16 +0000 Received: by mail-ej2-x0f.google.com with SMTP id a640c23a62f3a-c2e1d2d7dc9so156692466b.0 for ; Thu, 01 Oct 2026 14:14:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1790889253; x=1791494053; darn=lists.postgresql.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:content-type:from:to:cc :subject:date:message-id:reply-to:content-type; bh=tEj8KMOruQozcjGdSJOjkKc+IrEGglxYp2in+DOniXE=; b=ZMFPBzLhe1zunHKmlctYLYue27Yv3d84XL3o1li2vWtXAJx0W/p5orMiOxJJErC4Nl dnhM95WM8tkrLj96koZPpxJjclkaaLdtYHt8iGAT+7KcZJQZ6Q+3BeimxuYz+fqS+aFd IlNYFmtgfi1Jro5J8OShbKYUWLxNAN/JFHO4t3URgfcj2ZPGPD+/QHGyK5wLVCeFBA3h A5d1nTNAmyhvs6vaP3Vu9jOjNyEVNEU3hgoaX9m84WtvpzgfID1KVk/uJxM4WIBplTTv YjqGw/kyU2g5tNwSrHDkigFwKY3+Qzx2cwdG+XNR0ysDJqpHI+G3+lycFvBlZvbkXCZZ tq8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790889253; x=1791494053; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:content-type:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=tEj8KMOruQozcjGdSJOjkKc+IrEGglxYp2in+DOniXE=; b=iTtEveRTGFOIQs1WdEXQo+nkXyPd6T9JI40LrnszlCTentz4wnvXdTnPqMR0bDNzhr CyKcWSEn8x22A6jofk/WI7mo2e1+2WZervdnG2DcizJ6cJeP6bta4p0kR3UyG3WAE9Qh B+hztkPN2EKjOlcfqmkMrxbKbRixFS/+EiZDn6RBjnhZP3zdsTYq8xIIoW/amSImFvUE qCJQII0ArHJFLhWMb1FZ2XRer7hyKYIcFuyyzhC+id1jgDR6Km3AVbdPFbqY2cmtDPsT NBD3PVPyB1//Ds/iIomVbaHpFCRbXTBqPUcqQFJ8IHDQR0p+AtnAWqGoEKd4u/SqnMQg xeVg== X-Forwarded-Encrypted: i=1; AKwUvBwbrMN/OdVMd0KtW/AIQtjzxVEFcAP7YfnqQhGCO7NOQYyPE5pC7NcJGor7i4ApXFx1XzSEw+tYV49dkvZS@lists.postgresql.org X-Gm-Message-State: AFuF++l9wiyjvD4lAGZFIX8/Zw1t0XLOo5WnmpIOA4QYVddYTA7fRHj/ jLSYk04lAAko/9IQNCXScv1YFUSZbyPLJD8vw+lPTjXCWx7trgPIjrvd X-Gm-Gg: AYBFou2GaAhBfMCfkCfqaJCvFGefVoCB53U83O7vNYkV1pkjCyivft9KdWZdAioJSkF kSsjYK5py3selr8fyiZijUHtOjZ4SKmsa/cO6EzCcBzQGEO6eVBr4RPJqKsOHK2MSORMCXpnBst vtQqXQ0xXtrQiB/a7KVorqZ0InKnrW/Y2IgrY0UUWEhC2DtfJ9b+KEozz9GnZ7j4KXY4e7RcytM 0EkF6BbSQ+uBOslDojdOnArz90r94fysSRGWvEbthlH3/FLct4xKEx1h5g4lHEQ4rmb11ctMRSr A6EBfFko15nivmb6xSzvLRnVVPBEVBE7ukecKgZJQixpyFUzQJvXHilfH4bHVqiZB2RJMZCzhT+ aBy1pTql2wWVFDAzsgoxKJDVnOzT/EHAgPp8eVZiNMc2jU17V1zE8+ABbn94/TD1u6uC9syD3Jq 5xXtmReCqeR1BWCx+KxLvjdQ2KsOhaQYqI+sHt9irUdK8Ol9jZy46XC/6VX5QcWwSowLCjbG20W ASm+5RwmlqRiqSYaPVh3Q== X-Received: by 2002:a17:907:72c7:b0:c29:c575:de84 with SMTP id a640c23a62f3a-c2e4aa67cadmr76862766b.8.1790889252922; Thu, 01 Oct 2026 14:14:12 -0700 (PDT) Received: from smtpclient.apple ([109.36.231.157]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c2e4cf85881sm16233466b.56.2026.10.01.14.14.11 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Oct 2026 14:14:12 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3864.700.51.1.1\)) Subject: Re: COMMENTS are not being copied in CREATE TABLE LIKE From: Alex Liapychev In-Reply-To: <6cc4ef4b-f997-4453-ab40-bc012d342fa0@uni-muenster.de> Date: Thu, 1 Oct 2026 23:13:58 +0200 Cc: tomas@vondra.me, tgl@sss.pgh.pa.us, matheusssilv97 , Chao Li , "masao.fujii" , "david.g.johnston" , tgl , "huseyin.d3r" , pgsql-hackers , chochoforwork@gmail.com, 44973863@qq.com Content-Transfer-Encoding: quoted-printable Message-Id: <245F8C2C-11CF-4087-B050-1726558AA4A0@gmail.com> References: <2d41978b-3bca-4756-b0a0-b6e707ad7793@uni-muenster.de> <88b16128-d6f4-4a7b-a29a-fa0cd1c2084f@uni-muenster.de> <65963A8C-C1EE-431E-9513-C4AD16AEE789@gmail.com> <223a6be3-3917-47a4-9b5d-51720c60ad58@vondra.me> <36F56BBE-1499-4F82-AC03-05AAAE65D657@gmail.com> <6cc4ef4b-f997-4453-ab40-bc012d342fa0@uni-muenster.de> To: Jim Jones X-Mailer: Apple Mail (2.3864.700.51.1.1) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi Jim, Hi Tomas and Tom, First, let me address the specific questions. > On 1 Oct 2026, at 18:49, Jim Jones wrote: >=20 > On 01/10/2026 01:14, Alex Liapychev wrote: >>=20 >> My personal view is that adding this functionality carries more risks >> than leaving it out. Although the code is relatively small and = appears >> to work correctly, I would not merge it into the codebase. >=20 > You mean the multiple tables scenario or the whole patch? Yes, I meant the scenario involving multiple tables - specifically, the = concatenation of their comments.=20 Sorry I wasn=E2=80=99t clear about that here. >> An example of how this functionality could be used maliciously: >>=20 >> * A workflow creates a new table from several template tables in >> response to an event. >=20 > Can you elaborate more on this scenario? I'm afraid I didn't get your > point here. Thanks! >=20 I meant that CREATE TABLE is executed within some automatic flow, = without direct human supervision. For example, by a cron job or application=E2=80=99s code that executes = CREATE TABLE in response to some event. >> * An adversarial user with sufficient database access adds one = comment >> to each of two template tables. The combined size of these = comments >> exceeds |MaxAllocSize|, causing the automation to fail = unexpectedly. >=20 > An "adversarial" user with enough privileges can do many things break > it, like renaming a column causing a conflict. I see this large = comment > scenario as purely theoretical -- at least I fail to see any practical > use case ever exhausting this limit. Yes, this is a narrow and theoretical scenario. But introducing a way to = break the application still creates a real vulnerability, even if it = requires very specific conditions. The delay between the adversary=E2=80=99= s action (adding long comments) and the resulting failure (when CREATE = TABLE actually runs) makes the cause harder to identify and can help the = adversary remain undetected longer.=20 Second, let me explain my overall assessment. First of all, the code itself in v4 looks good. (The question of freeing = memory that I had, is answered by the Memory Contexts.) My concern is less about the implementation itself than about whether = the benefit justifies the long-term maintenance burden and the potential = security risk, however theoretical. As Tomas and Tom=E2=80=99s comments have highlighted, the underlying = issue is the lack of a clear use case. A concrete, practical use case would help establish whether those costs = and risks are justified at all, and which alternative to concatenation = to pick. That said, this is just my assessment as a reviewer. Thank you for your work on this patch and for taking the time to discuss = these concerns. Kind regards, Alex Liapychev=