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 1w76vn-004yDH-2f for pgsql-hackers@arkaria.postgresql.org; Mon, 30 Mar 2026 07:21:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w76vm-001pcQ-12 for pgsql-hackers@arkaria.postgresql.org; Mon, 30 Mar 2026 07:21:02 +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 1w76vm-001pcI-05 for pgsql-hackers@lists.postgresql.org; Mon, 30 Mar 2026 07:21:02 +0000 Received: from mail-lf1-x12c.google.com ([2a00:1450:4864:20::12c]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w76vj-00000001xDt-3e4l for pgsql-hackers@lists.postgresql.org; Mon, 30 Mar 2026 07:21:02 +0000 Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-5a27b5ad832so4729047e87.2 for ; Mon, 30 Mar 2026 00:21:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1774855259; cv=none; d=google.com; s=arc-20240605; b=dHu/qqn+eg3klqvvRzxk8j5nh0VqdkQVH+6ot0Lt+UOH+mYl3rfDqfzQ41EHuSuetm xZ/hEf7Hpi0N04fmi63Xy9rTboU0joRcG3Z5VXx5HRNhBARqu+z7sUeTTefbB0lQ2grh 3Osyrs7bcAI7H9Pj12JZ+NEqHzPo6YdmYCtYRKfe7yO/+IhM9Qj8GhhoTCXpTDhhsRm5 CiR5zD02f3FeupFs3d6QF/Ai4pyyw8/hb9vLyDqdX5N8G/hKv7DhdPookwrkcFO2F4nZ /lC12izxLlECwlWkU7sVN8I7glLLBPUvEtEivCNwJRGXcCCNujZxstGTv9Iq8ZJk2TR6 CT0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=9u0+9mJ6F+3UQOkoawwHwprxCesJtgD983sCFjo/cKk=; fh=rWCXmR9J6ImvDo5VgXliOu3ceL4TR2eLVRLFPa/0S3w=; b=cZQq0LyQAvGqcENp7O7ScdFnKgptGlv5m1Kjx10A0MBZ8G5YWABtA/EEh09RsP153J NR4DePMXkzceTCNR3vWRCzsJYIr8cOJMsU1goPMubwf6qF/3nqSxaHFzhl87d1Tu8H1F vA+jEQ9UHp2shWLxkKtf4VE3QOyMNP2lkyvWqHusZ+4MBbpIgYunMh6dFEmhV9YfRfOM pmrZVadj4tGgSI7IIGdq+y+6Xk8jrmVjyfY27rXvTSWaxeEBZgtWLaXoaHVRM4dWxpWo b8jEQUt7HbwKui+w6j0qEK3tW2562YDvBbCNFKuDEfi035ssvlW5LYnzJTs/gET+WeHo kqNg==; darn=lists.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=1774855259; x=1775460059; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=9u0+9mJ6F+3UQOkoawwHwprxCesJtgD983sCFjo/cKk=; b=bBderFIYS7GbIsewbWYlfsPFhzkiqGS10Sc+2HX7bmkt08dp/Aq0nrWVpsCftIz86T F3gvHGSqsKLz7/R8qLgTJMCC0vuOxQRi/DOpLHjhfjZSAhv0h93o1FCGZ4lBGB5Zg6CZ jpCIsZ9CwtpfKuu0bLPYbMswGMPfhWiHHINltREJx+W8MqsMAXMl60sT6yEnVJRgJzah QXLiv/tBzauG+/Tizv3Xnkg3VsXIU2HVDxv26FvO/KsLUsOEu/aO7AGfAmFcBw1iG8YG 82BW+5pJjXaF44Zg6HwUh6GqrNDilxP7GIOsWejHxhR5cO9ythmdwwn/KGNsMvdVO6oA AGGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774855259; x=1775460059; h=content-transfer-encoding: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=9u0+9mJ6F+3UQOkoawwHwprxCesJtgD983sCFjo/cKk=; b=buxV5LOFgJy1GKhnPrRZtSNfwG4XJnhbKh3PW3H5YhH23+L9moyp0Xov0+ktWAc39J k7Xn0scVtmmAYEIhBZOSGeMARSaJ4OeieWsH1/nx95WS0pqrxkBFHsn7SV20myqDR8Ol Uan0BUK+pbG37jqpc5taXQ4njYlzBR9oKmhJ2XXQsM5vr7UwD5TjppAfMxK8SVhIaxph O9aF4ERmXYURC+VLrpUTO1waO28oQuIJxLiO+T6rcctFJbgcsC2vKgiKoxdMWO5RtKQU +KOpMC9ErUF7Eb4cBKXQIX8LxTXi8Mi6uifk/AOJMhtHl9vO3ZtTVIevIM47D67aO+u3 1yCQ== X-Gm-Message-State: AOJu0YzyI9j71frNXwxPks/mwHTk1+qVOMFcQ31lKzBcPWqVv6N6cphT lyfwv0UibXCVTD5sbFEtGA2TlBaqErbIpX6DUCrxhtqU8rkes1qw96twYQkUNpksK72gi14IwD1 1JmNT0Xl353pnZXJKHByZHCjfYeWDHUPzui2L3JQ= X-Gm-Gg: ATEYQzzN+tQjmXn5Ylbktq39scoAApaNcO98pjlqDc/0/N+J9vDFhiUD/g9WgQ/+unw y/VTo4q3ygiNYn/s6OkW1YAoa68L2rA83SqREcFtQBgMzQwnK3dSzIhMhU5oXX/R/syeBIbioxC Dlsget7CMDB+8JNClVtiEDiWglYtw7E5tGLQoJ+U5zcEYO1iS8Jkn1hKyDZVQQHuCkrhErAfozM mmbh+0gEiDe+oCoFZRmZNZOBS24cMyrAO0SEvIpLKwgvTVfo5AQv5MvQTNyigISNphr4xtQ/NeA SHZfzeqjhsF11YXby99zFR2XDw6ewf45W7pZrbf7tg== X-Received: by 2002:a05:6512:234c:b0:5a1:2074:ef0 with SMTP id 2adb3069b0e04-5a2ab5fe512mr4715873e87.1.1774855258768; Mon, 30 Mar 2026 00:20:58 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Amit Kapila Date: Mon, 30 Mar 2026 12:50:47 +0530 X-Gm-Features: AQROBzDsV97Ikz4uiTsdWNl9uDAIHTOj98zTnPPZQ_tzixjK9im158qixnSa60c Message-ID: Subject: Re: pg_publication_tables: return NULL attnames when no column list is specified To: Roberto Mello Cc: PostgreSQL Developers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Mar 26, 2026 at 1:21=E2=80=AFAM Roberto Mello wrote: > > 2. b7ae0395369 (01/2023) Amit Kapila (author: Shi yu) > Ignore dropped and generated columns from the column list > > This is the commit that introduced the synthesis loop. It "solved" a prob= lem > where a table in two publications (one with a column list naming all colu= mns, > one without a column list) was erroring with "cannot use different column= lists" > because one returned NULL and the other returned an int2vector. The fix w= as > to synthesize a column list when none was specified, filtering out droppe= d > and generated columns, so that both publications would produce identical > int2vectors and DISTINCT would collapse them to one row. > > But this synthesis made it impossible to distinguish "all columns" from > "explicit list of all columns" in the view. And the relnatts heuristic fr= om > fd0b9dcebda - which was supposed to reverse the synthesis - was broken fr= om > the start because relnatts includes dropped columns while the synthesized= list > excludes them. > > The synthesis in b7ae0395369 tried to make "no column list" and "explicit= list > of all columns" look identical. But they have genuinely different > semantics: > > - No column list (NULL): all current and future columns are replicated. > ALTER TABLE ADD COLUMN automatically replicates the new column. > - Explicit full list: only the named columns are replicated. New columns > are NOT replicated until the publication is explicitly altered. > > By making them indistinguishable, the synthesis hid a real conflict from = users > who had a table in two publications with different column semantics on th= e > same subscription. I am proposing a fix that restores the distinction and= correctly > (IMO) surfaces this conflict. > I would like to understand why shall we consider this as a conflict? IIRC, we tried to ensure that if in future new columns get added to the relation and the same is not updated in the explicit column list then it will result in error. --=20 With Regards, Amit Kapila.