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.94.2) (envelope-from ) id 1u2L52-00GZXR-J6 for pgsql-hackers@arkaria.postgresql.org; Wed, 09 Apr 2025 02:22:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1u2L50-00HJnZ-Gw for pgsql-hackers@arkaria.postgresql.org; Wed, 09 Apr 2025 02:22:18 +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.94.2) (envelope-from ) id 1u2L4z-00HJnL-It for pgsql-hackers@lists.postgresql.org; Wed, 09 Apr 2025 02:22:18 +0000 Received: from fhigh-b6-smtp.messagingengine.com ([202.12.124.157]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1u2L4w-003n1K-1f for pgsql-hackers@lists.postgresql.org; Wed, 09 Apr 2025 02:22:16 +0000 Received: from phl-compute-05.internal (phl-compute-05.phl.internal [10.202.2.45]) by mailfhigh.stl.internal (Postfix) with ESMTP id 443A9254025E; Tue, 8 Apr 2025 22:22:13 -0400 (EDT) Received: from phl-imap-09 ([10.202.2.99]) by phl-compute-05.internal (MEProxy); Tue, 08 Apr 2025 22:22:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eulerto.com; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1744165333; x=1744251733; bh=HyQB81o9J9 XBcr7h2BszuYOGOZHmTKB6Qthgs8Fj9/k=; b=L9Hk5SDzjdF+H0amnRDWQNuVm5 kRVm4zZ7VNW20rHohzo1fjYPCoIZz56wNaepcohuMzkVE/HkvfZQUQwmf7Q6ZL0R Qx8VdUlZemYcLT9w7KzwraAaIXpK25FFe4Mwo4hUC63m85CFvAKb9njxiM09aH+w nWaNuMY0eaXanwrpQbh2lRgSr2cW18koGqMYrswoTsT2wrLvRKVuCaLfYFdrQhK7 AfwrMgPrF996+dSX9htL233/r3bEqhuZgX8G5FgayX3jJaBAFuW5q8tkEmv0aEDe 5DVsx+JHUpqKBZhq8bUW4eRUNvdWuS2zrkHuLvSx64XxAcaUQjXm+85CsLzw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1744165333; x=1744251733; bh=HyQB81o9J9XBcr7h2BszuYOGOZHmTKB6Qth gs8Fj9/k=; b=W78w6ztSIbWB79X2VBNeIsYkxPdQEglBqa9ZAgArJQPWW/GbGeG x8cdK0dd+xJqwHSjlC+iJQl1Vmg5iwVIqTJHe3MPsVMxYd2kSevOcyf9JyKs1Rus HwyBIBgqprGleDLdPXDVjAeCI8fb2e/ABVTihzoekyYC633aZof3rXxZYy+l4IDL gQB2mvs+917v8vL3/BOk6Q8wSBrk6SkkIbp+5p0Hsch4LfEXq8qqpYAaMohoNAhy qlcyZsMMa3/3wTB+VdOiSMhTvps+6Sx3d0bAcQc+gSBnkPn/fbwhSwfaI6T9/aiE UPUOlqrawwyPXaqAzkp+M9mgzvO5WFb/ycw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvtdegjeejucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih gvnhhtshculddquddttddmnecujfgurhepofggfffhvfevkfgjfhfutgesrgdtreerredt jeenucfhrhhomhepfdfguhhlvghrucfvrghvvghirhgrfdcuoegvuhhlvghrsegvuhhlvg hrthhordgtohhmqeenucggtffrrghtthgvrhhnpeduleekteeiueejjefhgffhieduhfet geejkedtjedvteekgedtjeduheeuheefkeenucffohhmrghinhepvghnthgvrhhprhhish gvuggsrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhf rhhomhepvghulhgvrhesvghulhgvrhhtohdrtghomhdpnhgspghrtghpthhtohepjedpmh houggvpehsmhhtphhouhhtpdhrtghpthhtoheprghmihhtrdhkrghpihhlrgduieesghhm rghilhdrtghomhdprhgtphhtthhopegvgigtlhhushhiohhnsehgmhgrihhlrdgtohhmpd hrtghpthhtohepnhgrthhhrghnuggsohhsshgrrhhtsehgmhgrihhlrdgtohhmpdhrtghp thhtohepphhgshhqlhdqhhgrtghkvghrsheslhhishhtshdrphhoshhtghhrvghsqhhlrd horhhgpdhrtghpthhtohepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihiidprhgtphht thhopehjkhgrthiisehpohhsthhgrhgvshhqlhdrohhrghdprhgtphhtthhopehtghhlse hsshhsrdhpghhhrdhprgdruhhs X-ME-Proxy: Feedback-ID: i0c21471d:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 812C3780069; Tue, 8 Apr 2025 22:22:12 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface MIME-Version: 1.0 X-ThreadId: T5b57cb2f17c64246 Date: Tue, 08 Apr 2025 23:21:31 -0300 From: "Euler Taveira" To: "Nathan Bossart" , "Amit Kapila" Cc: "Michael Paquier" , "Alexander Lakhin" , "Tom Lane" , "Jonathan S. Katz" , "PostgreSQL Hackers" Message-Id: <4c2a6100-738e-48cc-8a11-2d85f95ae0ed@app.fastmail.com> In-Reply-To: References: Subject: Re: Large expressions in indexes can't be stored (non-TOASTable) Content-Type: multipart/alternative; boundary=555e4b82ec384b8a8230f9853ab628ad List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --555e4b82ec384b8a8230f9853ab628ad Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Tue, Apr 8, 2025, at 5:25 PM, Nathan Bossart wrote: > On Tue, Apr 08, 2025 at 04:44:02PM +0530, Amit Kapila wrote: > > On Fri, Apr 4, 2025 at 7:58=E2=80=AFPM Nathan Bossart wrote: > >> On Fri, Apr 04, 2025 at 05:16:43PM +0530, Amit Kapila wrote: > >> > Can we dodge adding this push call if we restrict the length of t= he > >> > origin name to some reasonable limit like 256 or 512 and avoid the > >> > need of toast altogether? > >> > >> We did consider just removing pg_replication_origin's TOAST table e= arlier > >> [0], but we decided against it at that time. Maybe it's worth > >> reconsidering... > >=20 > > I don't see any good reason in that email for not removing the TOAST > > table for pg_replication_origin. I would prefer to remove it rather > > than add protection related to its access. >=20 > The only reason I can think of is that folks might have existing > replication origins with extremely long names that would cause upgrade= s to > fail. While I think it would be probably be okay to remove the TOAST = table > and restrict origin names to 512 bytes (like we did for password hashe= s in > commit 8275325), folks routinely complain about NAMEDATALEN, so I thin= k we > should be cautious here. The logical replication creates origin names as pg_SUBOID_RELID or pg_SU= BOID. It means the maximum origin name is 24. This limited origin name also ap= plies to pglogical that limits the name to 54 IIRC. I think that covers the ma= jority of the logical replication setups. There might be a small number of cust= om logical replication systems that possibly use long names for replication origin. I've never seen a replication origin name longer than NAMEDATALE= N. If you consider that the maximum number of replication origin is limited= to 2 bytes (65k distinct names), it is reasonable to restrict the replication origin names to 512 due to the high number of combinations. We generally expects that a catalog string uses "name" as type if it is an identifier= ; it could be the case for roname if author decided to be strict. This additional TOAST table has no or rare use. +1 for removing it. It i= s one less file, one less table and one less index; in short, one less source = of data corruption. ;) -- Euler Taveira EDB https://www.enterprisedb.com/ --555e4b82ec384b8a8230f9853ab628ad Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
On Tue, Apr 8, = 2025, at 5:25 PM, Nathan Bossart wrote:
On Tue, Apr 08, 2025 at 04:44:02PM +0530, A= mit Kapila wrote:
> On Fri, Apr 4, 2025 at 7:58=E2=80=AF= PM Nathan Bossart <nathan= dbossart@gmail.com> wrote:
>> On Fri, Apr 04,= 2025 at 05:16:43PM +0530, Amit Kapila wrote:
>> >= ; Can we dodge adding this push call if we restrict the length of the
>> > origin name to some reasonable limit like 256 = or 512 and avoid the
>> > need of toast altogethe= r?
>>
>> We did consider just re= moving pg_replication_origin's TOAST table earlier
>>= ; [0], but we decided against it at that time.  Maybe it's worth
>> reconsidering...
> 
=
> I don't see any good reason in that email for not removing the= TOAST
> table for pg_replication_origin. I would prefe= r to remove it rather
> than add protection related to = its access.

The only reason I can think of = is that folks might have existing
replication origins with= extremely long names that would cause upgrades to
fail.&n= bsp; While I think it would be probably be okay to remove the TOAST tabl= e
and restrict origin names to 512 bytes (like we did for = password hashes in
commit 8275325), folks routinely compla= in about NAMEDATALEN, so I think we
should be cautious her= e.

The logical replication cre= ates origin names as pg_SUBOID_RELID or pg_SUBOID.
It mean= s the maximum origin name is 24. This limited origin name also applies
to pglogical that limits the name to 54 IIRC. I think that = covers the majority
of the logical replication setups. The= re might be a small number of custom
logical replication s= ystems that possibly use long names for replication
origin= . I've never seen a replication origin name longer than NAMEDATALEN.
=

If you consider that the maximum number of rep= lication origin is limited to 2
bytes (65k distinct names)= , it is reasonable to restrict the replication
origin name= s to 512 due to the high number of combinations. We generally
<= div>expects that a catalog string uses "name" as type if it is an identi= fier; it
could be the case for roname if author decided to= be strict.

This additional TOAST table has= no or rare use. +1 for removing it. It is one
less file, = one less table and one less index; in short, one less source of data
=
corruption. ;)


--
Euler Taveira

--555e4b82ec384b8a8230f9853ab628ad--