| From: | Brent Verner <brent(at)rcfile(dot)org> | 
|---|---|
| To: | pgsql-hackers(at)postgresql(dot)org | 
| Subject: | TODO item inquiry/claim | 
| Date: | 2001-11-18 12:36:04 | 
| Message-ID: | 20011118073604.A6800@rcfile.org | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-hackers | 
Hi all,
In looking over the TODO doc, I saw
* Add table name mapping for numeric file names
  After reading the thread that bore that entry, I'd like to 
submit a bit of code for consideration, since it solves at least one 
of the problems raised in that thread.  You may fetch it from cvs;
 
 sh$ cvs -d :pserver:anoncvs(at)rcfile(dot)org:/var/cvs login
    [no password, just press enter]
 sh$ cvs -d :pserver:anoncvs(at)rcfile(dot)org:/var/cvs co pg_stat_du
 sh$ echo "read the README"
It's been tested with 7.1 and 7.2bN and is basically a few c functions
that allow (approximate) reports of disk usage (in Kb) per database, 
and  per relation (only on the current database, for now).
brent=# SELECT datname, pg_du_db(datname) AS diskusage FROM pg_database;
  datname  | diskusage 
-----------+-----------
 brent     |      1785
 template1 |      1713
 template0 |      1713
(3 rows)
brent=# select relname,pg_du_rel(relname) as diskusage from pg_class        
brent-# where (relkind='r' or relkind='i') order by diskusage desc;
             relname             | diskusage 
---------------------------------+-----------
 pg_proc                         |       252
 pg_proc_proname_narg_type_index |       236
 pg_description                  |       100
 pg_attribute                    |        92
 pg_operator                     |        84
...
  If you guys could suggest what needs to be added/modified to allow
Bruce to mark off that TODO item, I can probably get that done later
today.
cheers.
  brent
-- 
"Develop your talent, man, and leave the world something. Records are 
really gifts from people. To think that an artist would love you enough
to share his music with anyone is a beautiful thing."  -- Duane Allman
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tatsuo Ishii | 2001-11-18 14:17:48 | Re: Multilingual application, ORDER BY w/ different | 
| Previous Message | Tatsuo Ishii | 2001-11-18 12:05:05 | Re: OCTET_LENGTH is wrong |