BUG #18080: to_tsvector fails for long text input
The Post Office <noreply@postgresql.org>
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: uwe.binder@pass-consulting.com
Date: 2023-09-04T08:42:57Z
Lists: pgsql-bugs
The following bug has been logged on the website:
Bug reference: 18080
Logged by: Uwe Binder
Email address: uwe.binder@pass-consulting.com
PostgreSQL version: 13.11
Operating system: Rocky Linux 9
Description:
PostgreSQL 13.11 on x86_64-redhat-linux-gnu, compiled by gcc (GCC) 11.3.1
20221121 (Red Hat 11.3.1-4), 64-bit
SELECT to_tsvector('english'::regconfig, (REPEAT('<Long123456789/>'::text,
20000000)));
results in
ERROR: invalid memory alloc request size 2133333320
Where SELECT LENGTH(REPEAT('<Long123456789/>'::text, 20000000));
correctly returns 320000000 .
PostgresSQL is running in a Docker Container with 4GB.
Commits
-
Pack struct ParsedWord more tightly.
- 036297cf1b84 17.0 landed
-
Limit to_tsvector_byid's initial array allocation to something sane.
- cf1c65070a89 17.0 landed
- a2799f53d519 14.10 landed
- 8465efc1a0e7 16.1 landed
- 71bb73f60be7 15.5 landed
- 52a676ef4fc8 13.13 landed
- 4a81ed29d3c9 12.17 landed
- 0fb91ed2b0af 11.22 landed