Re: Dump size bigger than pgdata size?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Dump size bigger than pgdata size?
Дата
Msg-id 11486.1150909222@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Dump size bigger than pgdata size?  ("Nicola Mauri" <Nicola.Mauri@saga.it>)
Ответы Re: Dump size bigger than pgdata size?  (Jim Nasby <jnasby@pervasive.com>)
Список pgsql-admin
"Nicola Mauri" <Nicola.Mauri@saga.it> writes:
> I'm using pg_dump to take a full backup of my database using a compressed
> format:
>      $  pg_dump  -Fc  my_db > /backup/my_db.dmp

> It produces a 6 GB file whereas the pgdata uses only 5 GB of disk space:
> ...
> Database contains about one-hundred-thousands binary images, some of which
> may be already compressed.

Are those stored as bytea fields, or large objects, or what?

I can easily imagine bytea inflating to be larger in a dump than it is
on disk, since the text format for non-ASCII byte values looks like "\\nnn"
ie 5 bytes for only one byte on disk.  Assuming that ASCII bytes make up
about half of the data, the average expansion factor would be about 2.5x.
Compression of the dump text would buy back some of this bloat but
probably not all.

This could be avoided by using COPY BINARY format, but I don't see any
very nice way to do that in the context of pg_dump --- it needs to
intermix COPY data with SQL commands ...

            regards, tom lane

В списке pgsql-admin по дате отправления:

Предыдущее
От: Ivo Rossacher
Дата:
Сообщение: Re: "UNICODE" error during restoration
Следующее
От: Jeff Frost
Дата:
Сообщение: Re: strange fsm issues