Skip site navigation (1) Skip section navigation (2)

Re: pg_dump and database size question

From: Birta Levente <blevi(dot)linux(at)gmail(dot)com>
To: PostgreSQL general <pgsql-general(at)postgresql(dot)org>
Subject: pg_dump and database size question
Date: 2011-01-06 13:58:13
Message-ID: 4D25CA75.30100@gmail.com (view raw)
Hi,


I have postgres 9.0.2  server with a 2.4GB database.
After pg_dump of the database, the size increased with aprox 200MB ... why?
I make some tests and the total_relation_size is increased, but the 
relation_size not.

thanks

Birta Levente





From: Gary Chambers <gwchamb(at)gwcmail(dot)com>
To: Birta Levente <blevi(dot)linux(at)gmail(dot)com>
Cc: PostgreSQL general <pgsql-general(at)postgresql(dot)org>
Subject: Re: pg_dump and database size question
Date: 2011-01-06 16:21:18
Message-ID: alpine.DEB.2.00.1101061118390.32201@port.garychambers.com (view raw)
Birta,

> After pg_dump of the database, the size increased with aprox 200MB ...

How are you dumping the database?  Are you using -Fc on the command line, or
are you dumping to a text file?  I have nothing to quantify my comment, but
it seems possible that with a database of that size, the additional overhead
is related to it being a text-based dump file.

-- Gary Chambers

From: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Cc: Birta Levente <blevi(dot)linux(at)gmail(dot)com>
Subject: Re: pg_dump and database size question
Date: 2011-01-06 21:08:27
Message-ID: 201101061308.27982.adrian.klaver@gmail.com (view raw)
On Thursday 06 January 2011 5:58:13 am Birta Levente wrote:
> Hi,
>
>
> I have postgres 9.0.2  server with a 2.4GB database.
> After pg_dump of the database, the size increased with aprox 200MB ... why?
> I make some tests and the total_relation_size is increased, but the
> relation_size not.
>
> thanks
>
> Birta Levente

Are you saying the existing database increases in size after the dump or that 
when you dump/restore the restored db is greater in size than what it was 
previously?  Also if it was a dump/restore where you changing Postgres 
versions? In any case total_relation_size includes more information than 
relation_size; notably TOAST space, indexes, and two more of the data 
forks(main,fsm,vm). So the difference is in one of those. See here for more 
info: 
http://www.postgresql.org/docs/9.0/interactive/functions-admin.html

As to why, that probably depends on the answer to my previous questions.

-- 
Adrian Klaver
adrian(dot)klaver(at)gmail(dot)com


Privacy Policy | About PostgreSQL
Copyright © 1996-2013 The PostgreSQL Global Development Group