O'Reilly logo

PostgreSQL 9 Administration Cookbook by Hannu Krosing, Simon Riggs

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How much disk space is used by temporary data?

In addition to ordinary stable tables, you can also create temporary tables.

Also, PostgreSQL may use temporary files for query processing if it can't fit all the needed data to memory.

So, how do you find out how much data is used by temporary tables and files?

Getting ready

Same as previous—you can do this using any untrusted embedded language, or directly on the database host. You have to use an untrusted language, because trusted ones run in a sandbox, which prohibits them from accessing the host file system directly.

How to do it...

First, check if your database defines special tablespaces for temporary files as follows:

select current_setting('temp_tablespaces');

When temp_tablespaces has one or more ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required