Re: pg_dump --binary-upgrade out of memory

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Антон Глушаков <a(dot)glushakov86(at)gmail(dot)com>
Cc: pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: pg_dump --binary-upgrade out of memory
Date: 2024-02-13 18:30:08
Message-ID: 2658642.1707849008@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

=?UTF-8?B?0JDQvdGC0L7QvSDQk9C70YPRiNCw0LrQvtCy?= <a(dot)glushakov86(at)gmail(dot)com> writes:
> I encountered the problem of not being able to upgrade my instance (14->15)
> via pg_upgrade.
> The utility crashed with an error in out of memory.
> After researching a bit I found that this happens at the moment of export
> schema with pg_dump.
> Then I tried to manually perform a dump schema with the parameter
> --binary-upgrade option and also got an out of memory.
> Digging a little deeper, I discovered quite a large number of blob objects
> in the database (pg_largeobject 10GB and pg_largeobject_metadata 1GB (31kk
> rows))

Yeah, dumping a database with a lot of blobs is a known pain point.

I have some patches in progress that intend to make that better [1],
but they're meant for v17 and I'm not sure if you could get them to
work in v15. In the meantime, trying to run pg_dump on a beefier
machine might be your best option.

regards, tom lane

[1] https://commitfest.postgresql.org/47/4713/

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message M Sarwar 2024-02-13 20:08:25 pg_restore error
Previous Message Ron Johnson 2024-02-13 17:26:50 Re: Postgres upgrade from 9.6.9 to postgresql 16 version