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 22:03:13
Message-ID: CACpWLjMOXe4WR_vCc_ZXsnR16wdBAzq_zjkFfgQMOako9Ai7gA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

That appears to not be valid syntax.
create temporary table temp_rslt of ypxportal2__fgetquestions if not exists
on commit drop;
ERROR: syntax error at or near "if"
LINE 146: ...rary table temp_rslt of ypxportal2__fgetquestions if not exi..

https://www.postgresql.org/docs/9.2/static/sql-createtableas.html

Am I doing something wrong?

On Wed, Nov 2, 2016 at 2:52 PM, Michael Moore <michaeljmoore(at)gmail(dot)com>
wrote:

> I'll give that a go.
>
> On Wed, Nov 2, 2016 at 2:49 PM, David G. Johnston <
> david(dot)g(dot)johnston(at)gmail(dot)com> wrote:
>
>> On Wed, Nov 2, 2016 at 2:31 PM, Michael Moore <michaeljmoore(at)gmail(dot)com>
>> wrote:
>>
>>> ERROR: out of shared memory
>>> SQL state: 53200
>>> Hint: You might need to increase max_locks_per_transaction.
>>> Context: SQL statement "drop table if exists temp_rslt"
>>> ------------------------------------------------------------
>>> -------------
>>> Here is an overview of the processing that is causing this.
>>>
>>> I have a function I wrote named fGetQuestions. This function is very
>>> complex, but one of the things it does is create several TEMP tables. Here
>>> is a snipit of code that does it:
>>>
>>>> drop table if exists temp_rslt;
>>>>
>>>> drop table if exists campuslocation_rslt;
>>>>
>>>> drop table if exists final_rslt;
>>>>
>>>> create temporary table temp_rslt of ypxportal2__fgetquestions on commit
>>>>> drop;
>>>>
>>>> create temporary table campuslocation_rslt of ypxportal2__fgetquestions
>>>>> on commit drop;
>>>>
>>>> create temporary table final_rslt of ypxportal2__fgetquestions on
>>>>> commit drop;
>>>>
>>>> ​
>>>
>>
>> [...]
>>
>>
>>> ​
>>>
>>> Is there anything I can do to make sure that when fGetQuestions returns
>>> to mikes_fget_questions_tester() that all of the fGetQuestions
>>> resources are freed?
>>>
>>>
>> Maybe try losing the DROP TABLES and just do:​
>>
>> ​CREATE TEMP TABLE ... IF NOT EXISTS ... ON COMMIT DROP;
>> TRUNCATE ...;
>>
>> ​David J.​
>>
>>
>

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Pavel Stehule 2016-11-02 22:15:27 Re: Why does the PL/pgSQL compiler do this?
Previous Message Michael Moore 2016-11-02 21:52:43 Re: ERROR: out of shared memory