This folder is where PostgreSQL keeps all the data you insert on your databases (see PostgreSQL Database File Layout). Each sub-directory is used by a database in you cluster, the files inside them are the actual data of the relations (tables, indexes, sequences, ...).
So, your answer is no! You cannot clean it out, and if you do so, you will lose your data and PostgreSQL server will stop with a panic.
Basically, only files inside the
pg_log directory (if any) can be removed. A side note, do not, ever remove files inside
pg_xlog, it is not useless as the name may suggest (you didn't ask for it, but I saw happening sometimes).
Tips to solve your problem:
There are some things you can do to use less space in your case, like:
- Use another (not in RAM) tablespace for some tables or databases;
- Run a
VACUUM FULL. But notice that you will need some temporary space to do that, so you can't do it while you are really out of space;
pg_xlog to another location;
- As you said it is a temporary database, try to remove some indexes that are not been used.