Re: [GENERAL] fun fact about temp tables

2016-08-05 Thread Alex Ignatov
On 05.08.2016 18:54, Tom Lane wrote: Alex Ignatov writes: On 05.08.2016 17:51, Tom Lane wrote: Sure. Just like it reserves space for ordinary tables right away, long before there's any need to push the data out of shared_buffers. Otherwise, you might find yourself

Re: [GENERAL] fun fact about temp tables

2016-08-05 Thread Grigory Smolkin
On 08/05/2016 07:18 PM, Andrew Sullivan wrote: On Fri, Aug 05, 2016 at 06:02:08PM +0300, Grigory Smolkin wrote: 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?

Re: [GENERAL] fun fact about temp tables

2016-08-05 Thread Andrew Sullivan
On Fri, Aug 05, 2016 at 06:02:08PM +0300, Grigory Smolkin wrote: > 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? Surely, that the transaction operates in a

Re: [GENERAL] fun fact about temp tables

2016-08-05 Thread Grigory Smolkin
I can get error anyway on first select because of hint bit write. no? On 08/05/2016 06:54 PM, Tom Lane wrote: Alex Ignatov writes: On 05.08.2016 17:51, Tom Lane wrote: Sure. Just like it reserves space for ordinary tables right away, long before there's any need

Re: [GENERAL] fun fact about temp tables

2016-08-05 Thread Tom Lane
Alex Ignatov writes: > On 05.08.2016 17:51, Tom Lane wrote: >> Sure. Just like it reserves space for ordinary tables right away, >> long before there's any need to push the data out of shared_buffers. >> Otherwise, you might find yourself having to throw an "out of disk

Re: [GENERAL] fun fact about temp tables

2016-08-05 Thread Tom Lane
Grigory Smolkin 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

Re: [GENERAL] fun fact about temp tables

2016-08-05 Thread Alex Ignatov
On 05.08.2016 17:51, Tom Lane wrote: Grigory Smolkin writes: I`ve noticed interesting aspect in temp tables working. It appears postgres is trying to reserve space on disk for temp tables even before temp_buffers overflow. Sure. Just like it reserves space for

Re: [GENERAL] fun fact about temp tables

2016-08-05 Thread Grigory Smolkin
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? On 08/05/2016 05:51 PM, Tom Lane wrote: Grigory Smolkin

Re: [GENERAL] fun fact about temp tables

2016-08-05 Thread Tom Lane
Grigory Smolkin writes: > I`ve noticed interesting aspect in temp tables working. It appears > postgres is trying to reserve space on disk for temp tables even before > temp_buffers overflow. Sure. Just like it reserves space for ordinary tables right away, long

[GENERAL] fun fact about temp tables

2016-08-05 Thread Grigory Smolkin
Hello, everyone! I`ve noticed interesting aspect in temp tables working. It appears postgres is trying to reserve space on disk for temp tables even before temp_buffers overflow. test4=# show temp_buffers ; temp_buffers -- 8MB test4=# create temp table t(a int, b int);