Re: [ADMIN] database size much bigger than tablespaces on filesystem

2011-09-14 Thread Gabriele Bartolini
Hi, On Wed, 14 Sep 2011 04:03:45 -0700, Rob Audenaerde rob.audenae...@valuecare.nl wrote: Is this corruption of the database? Or are there ways to 'fix' this oddity? Try VACUUM ANALYSE and repeat the operation. Thanks, Gabriele -- Gabriele Bartolini - 2ndQuadrant Italia PostgreSQL

Re: [ADMIN] database size much bigger than tablespaces on filesystem

2011-09-14 Thread Guillaume Lelarge
On Wed, 2011-09-14 at 04:03 -0700, Rob Audenaerde wrote: I have a Postgresql 8.3 instance with tablespaces totalling on about 74G. This is fine. But if I ask Postgresql how big my database is, I get a (unexpected) large answer: 595 GB. This seems very strange. Disk I/O tests on the

Re: [ADMIN] database size much bigger than tablespaces on filesystem

2011-09-14 Thread Rob Audenaerde
On Wed, 2011-09-14 at 04:03 -0700, Rob Audenaerde wrote: I have a Postgresql 8.3 instance with tablespaces totalling on about 74G. This is fine. But if I ask Postgresql how big my database is, I get a (unexpected) large answer: 595 GB. This seems very strange. Disk I/O tests on the system

Re: [ADMIN] database size much bigger than tablespaces on filesystem

2011-09-14 Thread Tom Lane
Rob Audenaerde rob.audenae...@valuecare.nl writes: I check te database size like this: select pg_size_pretty(pg_database_size('database')) 595 GB You should also check the space held in $PGDATA/base. I did. It is only 320 MB. Bizarre. Try breaking the results down table-by-table to see if

Re: [ADMIN] database size much bigger than tablespaces on filesystem

2011-09-14 Thread Rob Audenaerde
I check te database size like this: select pg_size_pretty(pg_database_size('database')) 595 GB You should also check the space held in $PGDATA/base. I did. It is only 320 MB. Bizarre. Try breaking the results down table-by-table to see if you can find where the discrepancy is.

Re: [ADMIN] database size much bigger than tablespaces on filesystem

2011-09-14 Thread Tom Lane
Rob Audenaerde rob.audenae...@valuecare.nl writes: It gets stranger. I try this: select tablename , pg_relation_size(tablename) , pg_size_pretty(pg_relation_size(tablename) ) as relsize , pg_size_pretty(pg_total_relation_size(tablename) ) as disksize , pg_total_relation_size(tablename)