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 1vbdUQ-009Y0n-0V for pgsql-hackers@arkaria.postgresql.org; Fri, 02 Jan 2026 11:38:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vbdUO-009uVW-0H for pgsql-hackers@arkaria.postgresql.org; Fri, 02 Jan 2026 11:38:40 +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 1vbdUN-009uVO-2L for pgsql-hackers@lists.postgresql.org; Fri, 02 Jan 2026 11:38:40 +0000 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vbdUL-0044lo-1j for pgsql-hackers@lists.postgresql.org; Fri, 02 Jan 2026 11:38:39 +0000 Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-b76b5afdf04so1831020866b.1 for ; Fri, 02 Jan 2026 03:38:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1767353917; x=1767958717; darn=lists.postgresql.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=I4RA4ANTtXlmsK5Qj0qcTHHPGfuZSwf4Ltva3Uw97Fg=; b=gpuWEdwVlw68Zib37pw97g8gKHNuRyZPwKX6GI8etkBG4Cqe0+0DjxUu+NCwnRpRdD ZnVvmMUzQCcZ86Ji23WRHjBGsvw29oOy77jsGG6BuuiPwMNhWZZTu0akrOyrdaye64cS 329v3HGXjIGcj9Rwc6Qza7EqgXctGOpnEO37z5grvo37yFzJbPWrghYJarXcf3ASpjM4 5eOeb98c3fkiahuTZ3xIk2hlHowUvNSo3RpcexfrIjlFpV2p52U2c0u0Dxz4WBrQkpbO ahgaVkDWPrjnTBQStXyHSngjGGMPorKsNBIgT68xZCH5+sEkJMVoSiTDuYFyr4HKHnsg ioew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767353917; x=1767958717; h=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=I4RA4ANTtXlmsK5Qj0qcTHHPGfuZSwf4Ltva3Uw97Fg=; b=QOsWlf6QY7iGx0D0HNux8xUuszPAZN9mcK2ahQwdu9AAUZLomd/J2lo0O8DY9Niy26 h2VZO/4x9tnB9Fs1Mb/9atb5Aqx/YkT9FVOAVCsh2b6RgCOWe7S6Dcyk996NN5Tl6g+u jOyrK+cr+GeiK7uPpk4/0nzICHqJideyPDaWsjrm2NGmYxNOzkyAqfGCg8kOoUMl/E0R RwED9GWsWBEYEV45X7sAsvg5ArB9HbHlM6Cgc4uh7Haapn8bw9hpiR8Cn4qJgNLynJng 0GJqgYlbAOOxFQV7DG7tDFveD0jCRrVBRb58/koFIT6m7U4AgRe0jc8XWQixDq7p1hFP 7aAw== X-Gm-Message-State: AOJu0Yz7h2WR8Z9ILElTk7MXfzW+cVTBPH6Fmx5DzlCmEKpKgomlX/EB daGacI0fOa5yf7eP0oks0QShavPG0Z6WYCTzdMBixrLtajQV8FQ3dfR3qHTVLUY2c9ZbFeRY176 05DKDAP34sRiNZgh9OywqYFOBnsWp/mcp0RZc X-Gm-Gg: AY/fxX60Cex6nlD0X6OaCOSfNYaENStQxn/UFHcXx/nDMz0wBBbeHTYKyz/SDNY1G83 PjKT0+bYfFC/P3ixxVJjMU0lMruHJ+yLQsk6J/MfA+vIrDREnxTrV2Z+4lza4OJUqw5LdI3lLsF A64bW3DybdL2tdlQHeD6tYwYb5635bFOGj+PvDUrcz99OX6ExJnbFyxe0ni+ShJvlHMKFFx2n8D FzOFxgTJrMz77UGYdKT4jYRxv2mJi/HFvpv+WnJStaM0rse4k5OA5i3p+S8uXpD9/5pjEMj7l8g Y5PhBs6SqZf9n8ALxQuOEJXpMw2n0g== X-Google-Smtp-Source: AGHT+IGy3649fJRe1nBX0HVIg2oajxSxwxa8t43aP5zsgmoYHcRRmcNWsK51U2lt2PPNjss3wrhAv64+7kw14kSb7iY= X-Received: by 2002:a17:907:724e:b0:b6d:5bc3:e158 with SMTP id a640c23a62f3a-b8036f2ac34mr4456479666b.17.1767353916466; Fri, 02 Jan 2026 03:38:36 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Dharin Shah Date: Fri, 2 Jan 2026 12:38:25 +0100 X-Gm-Features: AQt7F2ojAYz8FiF7ts7ZrOkXlRR00vkt3Gk8VAsFAjaZWyitWHahBNlllg2dakY Message-ID: Subject: Re: [PATCH][DOC][MINOR] Fix incorrect lexeme limit in textsearch docs To: pgsql-hackers@lists.postgresql.org Content-Type: multipart/alternative; boundary="00000000000062291b06476626ca" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000062291b06476626ca Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello, Gentle ping on the textsearch docs patch. Happy to address any feedback Thanks, Dharin On Sat, Dec 27, 2025 at 10:09=E2=80=AFPM Dharin Shah wrote: > Hello, > > A minor doc patch for this page > https://www.postgresql.org/docs/current/textsearch-limitations.html > and this line > > *- The number of lexemes must be less than 2^64* > > Docs wrongly claim "lexemes must be < 2^64" but the actual constraint is > 1 MB total storage (MAXSTRPOS), and no 2^64 check exists in the code. > > From src/include/tsearch/ts_type.h: > >> #define MAXSTRPOS ( (1<<20) - 1) // 1,048,575 bytes >> >> typedef struct { >> int32 size; // number of lexemes >> ... >> } TSVectorData; > > > The attached patch: > - Removes the incorrect 2^64 claim > - Clarifies this means "distinct lexemes in a single tsvector value" > > Thanks, > Dharin > --00000000000062291b06476626ca Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello,

Gentle ping on the textsearch do= cs patch. Happy to address any feedback

Thanks,
Dharin

On Sat, Dec 27, 2025 at 10:09=E2= =80=AFPM Dharin Shah <dharinsh= ah95@gmail.com> wrote:
Hello,

and this line

=
- The number of lexemes must be less = than 2^64

Docs wrongly claim "lexe= mes must be < 2^64" but the actual constraint is
1 MB total sto= rage (MAXSTRPOS), and no 2^64 check exists in the code.

From = src/include/tsearch/ts_type.h:
=C2=A0 =C2=A0 #define MAXSTRPOS ( (1<<20) - 1) =C2=A0 = // 1,048,575 bytes

=C2=A0 =C2=A0 typedef struct {
=C2=A0 =C2=A0 = =C2=A0 =C2=A0 int32 =C2=A0size; =C2=A0 =C2=A0 // number of lexemes
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 ...
=C2=A0 =C2=A0 } TSVectorData;
<= div>
=C2=A0The attached patch:
- Removes the incorrect 2^64 claim- Clarifies this means "distinct lexemes in a single tsvector value&= quot;

Thanks,
Dharin
--00000000000062291b06476626ca--