Re: ERROR: out of shared memory

From: Michael Moore <michaeljmoore(at)gmail(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: postgres list <pgsql-sql(at)postgresql(dot)org>
Subject: Re: ERROR: out of shared memory
Date: 2016-11-02 23:31:35
Message-ID: CACpWLjMAi670q5QGYu=fHs8xEWSJNMNZPy3mrucKFQ-RwtyqnA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Yes, I reversed my Methods in my summation. If I understand you correctly
you are suggesting that I try:

create temporary table if not exists temp_rslt of
ypxportal2__fgetquestions on commit drop;
truncate temp_rslt ;

I tried it and it works !!!

no more ERROR: out of shared memory !!!

Thanks so much!
Mike

On Wed, Nov 2, 2016 at 4:08 PM, David G. Johnston <
david(dot)g(dot)johnston(at)gmail(dot)com> wrote:

> On Wed, Nov 2, 2016 at 4:06 PM, David G. Johnston <
> david(dot)g(dot)johnston(at)gmail(dot)com> wrote:
>
>> On Wed, Nov 2, 2016 at 3:55 PM, Michael Moore <michaeljmoore(at)gmail(dot)com>
>> wrote:
>>
>>> David,
>>> I think that: ...
>>>
>>> Method 1
>>> *create temporary table if not exists temp_rslt of
>>> ypxportal2__fgetquestions on commit drop;*
>>>
>>> is not functionally equivalent to
>>>
>>> Method 2
>>>
>>> *drop table if exists temp_rslt;*
>>> *create temporary table temp_rslt of ypxportal2__fgetquestions on
>>> commit drop;*
>>>
>>> For example:
>>>
>>> step 1. A calls B
>>> step 2. B creates *temp_rslt* table (substitute Method 1 or
>>> Method 2 at this step)
>>> step 3. B inserts one record into *temp_rslt*
>>> step 4. B returns, without error, to A -- note, no commit is done
>>> step 5. repeat #1
>>>
>>> If, at step 2, we use Method 1, then count(*) *temp_rslt* will never
>>> be more than 1.
>>> If, at step 2, we use Method 2, then count(*) *temp_rslt* will
>>> increment with each iteration of steps 1 thru 5.
>>>
>>> Make sense?
>>>
>>>
>> ​You missed the part where you immediately TRUNCATE the table after
>> conditionally creating it...
>>
>>
> ​And no, Method 2 will reset since you are continually dropping it.
>
> Method 1, without Truncate, will do the incrementing while Method 2 will
> not.​
>
> David J.
>
>

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Amitabh Kant 2016-11-03 03:50:26 Re: Fwd: Regarding change in the size of database
Previous Message David G. Johnston 2016-11-02 23:08:54 Re: ERROR: out of shared memory