From: Daniel Verite <daniel@manitou-mail.org>
To: Charles Martin <ssappeals@gmail.com>
Cc: Adrian Klaver <adrian.klaver@aklaver.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: Trouble Upgrading Postgres
Date: Mon, 05 Nov 2018 18:54:21 +0100
Message-ID: <d31de2ca-5a8d-468d-8b86-b66c294f9464@manitou-mail.org> (raw)
In-Reply-To: <CAFw6=U2ORvfF7y-pynxmmBsMwg+sczN45z99J_941Ws89JZ4ww@mail.gmail.com>
Charles Martin wrote:
> SELECT max(length(docfilecontents::text)) FROM docfile;
> and after a very long time, got:
> ERROR: invalid memory alloc request size 1636085512 SQL state: XX000
It would mean that at least one row has a "docfilecontents"
close to 0.5GB in size. Or that the size fields in certain rows
are corrupted, although that's less plausible if you have
no reason to suspect hardware errors.
Does the following query work:
SELECT max(octet_length(docfilecontents)) FROM docfile;
or maybe a histogram by size in hundred of megabytes:
SELECT octet_length(docfilecontents)/(1024*1024*100),
count(*)
FROM docfile
GROUP BY octet_length(docfilecontents)/(1024*1024*100);
Note that the error message above does not say that there's not enough
free memory, it says that it won't even try to allocate that much, because
1636085512 is over the "varlena limit" of 1GB.
AFAICS I'm afraid that this table as it is now cannot be exported
by pg_dump, even if you had enough free memory, because any individual
row in COPY cannot exceed 1GB in text format.
Best regards,
--
Daniel Vérité
PostgreSQL-powered mailer: http://www.manitou-mail.org
Twitter: @DanielVerite
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: daniel@manitou-mail.org, ssappeals@gmail.com, adrian.klaver@aklaver.com, tgl@sss.pgh.pa.us
Subject: Re: Trouble Upgrading Postgres
In-Reply-To: <d31de2ca-5a8d-468d-8b86-b66c294f9464@manitou-mail.org>
References: <CAFw6=U2ORvfF7y-pynxmmBsMwg+sczN45z99J_941Ws89JZ4ww@mail.gmail.com> <d31de2ca-5a8d-468d-8b86-b66c294f9464@manitou-mail.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox