Re: fun fact about temp tables

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Grigory Smolkin <g(dot)smolkin(at)postgrespro(dot)ru>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: fun fact about temp tables
Date: 2016-08-05 15:50:47
Message-ID: 16963.1470412247@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Grigory Smolkin <g(dot)smolkin(at)postgrespro(dot)ru> writes:
> Thank you for your answer.
> But it`s temporary table so it`s equal to saying 'I don`t care about
> this data' and I can get 'out of disk space' regardless of using
> temporary tables.

> What are we winning here?

Sane behavior. Would you really want this:

=> CREATE TEMP TABLE foo(...);
CREATE TABLE
=> INSERT INTO foo SELECT lots-o-rows;
INSERT nnnn
... much later ...
=> SELECT * FROM unrelated_temp_table;
ERROR: out of disk space

If we might suffer out-of-disk-space while flushing a buffer, that's
what we'd risk. So we allocate the disk space before accepting the
INSERT in the first place.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2016-08-05 15:54:22 Re: fun fact about temp tables
Previous Message Alex Ignatov 2016-08-05 15:16:04 Re: fun fact about temp tables