Re: [GENERAL] pg_database_size differs from df -s

2012-06-07 Thread Vincent Veyron
Le mercredi 06 juin 2012 à 21:45 +0200, Frank Lanitz a écrit : > On Wed, 6 Jun 2012 20:31:36 +0200 > Alban Hertroys wrote: > > > On 6 Jun 2012, at 16:33, Frank Lanitz wrote: > > > > > > Is your du reporting sizes in Bytes or blocks or ...? > > Should be byte as its a linux. > Not sure abou

Re: [GENERAL] pg_database_size differs from df -s

2012-06-06 Thread Frank Lanitz
On Wed, 6 Jun 2012 20:31:36 +0200 Alban Hertroys wrote: > On 6 Jun 2012, at 16:33, Frank Lanitz wrote: > > > the result is much bigger than running a df -s over the postgres > > folder > > - Its about factor 5 to 10 depending on database. > > > Is your du reporting sizes in Bytes or blocks or

Re: [GENERAL] pg_database_size differs from df -s

2012-06-06 Thread Guillaume Lelarge
On Wed, 2012-06-06 at 18:46 +0200, Julien Rouhaud wrote: > On Wed, Jun 6, 2012 at 6:28 PM, Tom Lane wrote: > > > Frank Lanitz writes: > > > Am 06.06.2012 17:49, schrieb Tom Lane: > > >> For me, pg_database_size gives numbers that match up fairly well with > > >> what "du" says. I would not expe

Re: [GENERAL] pg_database_size differs from df -s

2012-06-06 Thread Alban Hertroys
On 6 Jun 2012, at 16:33, Frank Lanitz wrote: > the result is much bigger than running a df -s over the postgres folder > - Its about factor 5 to 10 depending on database. Is your du reporting sizes in Bytes or blocks or ...? Alban Hertroys -- The scale of a problem often equals the size of an

Re: [GENERAL] pg_database_size differs from df -s

2012-06-06 Thread Julien Rouhaud
On Wed, Jun 6, 2012 at 6:28 PM, Tom Lane wrote: > Frank Lanitz writes: > > Am 06.06.2012 17:49, schrieb Tom Lane: > >> For me, pg_database_size gives numbers that match up fairly well with > >> what "du" says. I would not expect an exact match, since du probably > >> knows about filesystem over

Re: [GENERAL] pg_database_size differs from df -s

2012-06-06 Thread Tom Lane
Frank Lanitz writes: > Am 06.06.2012 17:49, schrieb Tom Lane: >> For me, pg_database_size gives numbers that match up fairly well with >> what "du" says. I would not expect an exact match, since du probably >> knows about filesystem overhead (such as metadata) whereas >> pg_database_size does not

Re: [GENERAL] pg_database_size differs from df -s

2012-06-06 Thread Frank Lanitz
Am 06.06.2012 17:49, schrieb Tom Lane: > Frank Lanitz writes: >> I've got an issue I'm not sure I might have a misunderstanding. When >> calling > >> select sum(pg_database_size(datid)) as total_size from pg_stat_database > >> the result is much bigger than running a df -s over the postgres fold

Re: [GENERAL] pg_database_size differs from df -s

2012-06-06 Thread Tom Lane
Frank Lanitz writes: > I've got an issue I'm not sure I might have a misunderstanding. When > calling > select sum(pg_database_size(datid)) as total_size from pg_stat_database > the result is much bigger than running a df -s over the postgres folder > - Its about factor 5 to 10 depending on data

[GENERAL] pg_database_size differs from df -s

2012-06-06 Thread Frank Lanitz
Hi folks, I've got an issue I'm not sure I might have a misunderstanding. When calling select sum(pg_database_size(datid)) as total_size from pg_stat_database the result is much bigger than running a df -s over the postgres folder - Its about factor 5 to 10 depending on database. My understandi

Re: [GENERAL] pg_database_size(oid)

2010-02-17 Thread Greg Smith
Dhimant Patel wrote: I have created a database, which I plan to load with several tables. I am trying to find the size of the databases and came across pg_database_size(oid) function. Here's what you probably want: select datname,pg_size_pretty(pg_database_size(pg_database.oid)) from pg_data

Re: [GENERAL] pg_database_size(oid)

2010-02-17 Thread Reid Thompson
On Wed, 2010-02-17 at 11:59 -0500, Dhimant Patel wrote: > > I have created a database, which I plan to load with several tables. I > am trying to find the size of the databases and came > across pg_database_size(oid) function. Since it requires databse oid, > I thought there must be a view where

Re: [GENERAL] pg_database_size(oid)

2010-02-17 Thread Tom Lane
Dhimant Patel writes: > I have created a database, which I plan to load with several tables. I am > trying to find the size of the databases and came > across pg_database_size(oid) function. Since it requires databse oid, I > thought there must be a view where you get it - then came across > "pg_d

[GENERAL] pg_database_size(oid)

2010-02-17 Thread Dhimant Patel
Hi All, I have just started with postgres and after going through manual nearly for 2 hours, I need help. I have created a database, which I plan to load with several tables. I am trying to find the size of the databases and came across pg_database_size(oid) function. Since it requires databse oi

Re: [GENERAL] pg_database_size

2010-01-16 Thread John R Pierce
AI Rumman wrote: What does pg_database_size resturs? Bytes or KB? those functions all return size in bytes. you can use pg_size_pretty(pg_database_size('dbname')) to pretty print it as MB or whatever is most appropriate. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org

[GENERAL] pg_database_size

2010-01-16 Thread AI Rumman
What does pg_database_size resturs? Bytes or KB? Please tell.