diff options
| author | Tom Lane | 2026-08-17 22:17:51 +0000 |
|---|---|---|
| committer | Tom Lane | 2026-08-17 22:17:51 +0000 |
| commit | c5450dcb3fe70bee79fdfe8a89f84dd8fffb566e (patch) | |
| tree | e558a98b0a3547f64c9a0c8f778a2814c673c6b2 | |
| parent | 91989795d2876c5105171226eb1fd24eabe97504 (diff) | |
Doc: clean up documentation about text search datatype limits.
textsearch.sgml neglected to mention that the MAXSTRPOS total-length
limit applies to tsquery as well as tsvector. It also claims that
there is a 32K limit on the total number of nodes in a tsquery, which
is wrong. (I suspect that QueryOperator.left may once have been
int16, which would give rise to such a limit. But it's uint32 now,
so you'd hit the 1GB varlena limit well before overflowing that.)
While at it, re-order the bullet points into an order that makes
more sense, to me anyway.
Reported-by: Claude Code (via Noah Misch)
Author: Tom Lane <tgl@sss.pgh.pa.us>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Discussion: https://postgr.es/m/455079.1786897319@sss.pgh.pa.us
Backpatch-through: 14
| -rw-r--r-- | doc/src/sgml/textsearch.sgml | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/doc/src/sgml/textsearch.sgml b/doc/src/sgml/textsearch.sgml index bf91c23bd11..db8e40ea7e3 100644 --- a/doc/src/sgml/textsearch.sgml +++ b/doc/src/sgml/textsearch.sgml @@ -3993,29 +3993,24 @@ Parser: "pg_catalog.default" <para>The length of each lexeme must be less than 2 kilobytes</para> </listitem> <listitem> - <para>The length of a <type>tsvector</type> (lexemes + positions) must be - less than 1 megabyte</para> - </listitem> - <listitem> - <!-- TODO: number of lexemes in what? This is unclear --> - <para>The number of lexemes must be less than - 2<superscript>64</superscript></para> + <para>No more than 256 positions per lexeme</para> </listitem> <listitem> <para>Position values in <type>tsvector</type> must be greater than 0 and no more than 16,383</para> </listitem> <listitem> - <para>The match distance in a <literal><<replaceable>N</replaceable>></literal> - (FOLLOWED BY) <type>tsquery</type> operator cannot be more than - 16,384</para> + <para>The length of a <type>tsvector</type>'s data (lexemes + positions) + must be less than 1 megabyte</para> </listitem> <listitem> - <para>No more than 256 positions per lexeme</para> + <para>The length of a <type>tsquery</type>'s data (lexemes only) + must be less than 1 megabyte</para> </listitem> <listitem> - <para>The number of nodes (lexemes + operators) in a <type>tsquery</type> - must be less than 32,768</para> + <para>The match distance in a <literal><<replaceable>N</replaceable>></literal> + (FOLLOWED BY) <type>tsquery</type> operator cannot be more than + 16,384</para> </listitem> </itemizedlist> </para> |
