vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Greetings, Can someone help me with the syntax for running a postgres function from the within psql? I need to know the size of several databases. The postgres documentation says there is a function that will do what I need. The function is pg_database_size(name). I tried select pg_database-_size(km). The response I get says there is no column "km". I think I must be using the wrong syntax, but haven't found a reference to what the correct syntax is. Thanks, Carol Walter ---------------------------(end of broadcast)--------------------------- TIP 4: Have you searched our list archives? http://archives.postgresql.org |
| |||
| select datid from pg_stat_database where datname='km'; select database_size(that_id); -----Original Message----- From: pgsql-admin-owner@postgresql.org [mailto Sent: Nov 13, 2007 9:35 AM To: pgsql-admin@postgresql.org Subject: [ADMIN] Help with command syntax? Greetings, Can someone help me with the syntax for running a postgres function from the within psql? I need to know the size of several databases. The postgres documentation says there is a function that will do what I need. The function is pg_database_size(name). I tried select pg_database-_size(km). The response I get says there is no column "km". I think I must be using the wrong syntax, but haven't found a reference to what the correct syntax is. Thanks, Carol Walter ---------------------------(end of broadcast)--------------------------- TIP 4: Have you searched our list archives? http://archives.postgresql.org ---------------------------(end of broadcast)--------------------------- TIP 7: You can help support the PostgreSQL project by donating at http://www.postgresql.org/about/donate |
| ||||
| You need to put the database name in single quotes: select pg_database_size('km'); Regards, Alex. Carol Walter wrote: > Greetings, > > Can someone help me with the syntax for running a postgres function > from the within psql? I need to know the size of several databases. > The postgres documentation says there is a function that will do what > I need. The function is pg_database_size(name). I tried select > pg_database-_size(km). The response I get says there is no column > "km". I think I must be using the wrong syntax, but haven't found a > reference to what the correct syntax is. > > Thanks, > Carol Walter > > ---------------------------(end of broadcast)--------------------------- > TIP 4: Have you searched our list archives? > > http://archives.postgresql.org > > > This email has been scanned for viruses by Blackspider's Mail Control > System.For more information please visit http://www.blackspider.com This message has been scanned for malware by SurfControl plc. www.surfcontrol.com ---------------------------(end of broadcast)--------------------------- TIP 6: explain analyze is your friend |