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:55:57 |
Message-ID: | CACpWLjNM8Y1u53orm55m3S-K7UyR_eCKxSguzza5=LN_sUeb5Q@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
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?
On Wed, Nov 2, 2016 at 3:33 PM, David G. Johnston <
david(dot)g(dot)johnston(at)gmail(dot)com> wrote:
>
>
> On Wed, Nov 2, 2016 at 3:29 PM, David G. Johnston <
> david(dot)g(dot)johnston(at)gmail(dot)com> wrote:
>
>> On Wed, Nov 2, 2016 at 3:28 PM, David G. Johnston <
>> david(dot)g(dot)johnston(at)gmail(dot)com> wrote:
>>
>>> On Wed, Nov 2, 2016 at 3:03 PM, Michael Moore <michaeljmoore(at)gmail(dot)com>
>>> wrote:
>>>
>>>> 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?
>>>>
>>>
>>> I always get the placement of IF NOT EXISTS confused - but you found
>>> the doc page with the syntax definition, do you have a question regarding
>>> what the correct order of parts should be?
>>>
>>>
>> Actually, you didn't find the correct page...
>>
>> This is a "CREATE TABLE" not "CREATE TABLE AS" command...
>>
>>
> And the CREATE TABLE AS command does have IF NOT EXISTS - just not back
> in 9.2 which is what you linked to...
>
> David J.
>
>
From | Date | Subject | |
---|---|---|---|
Next Message | David G. Johnston | 2016-11-02 23:06:27 | Re: ERROR: out of shared memory |
Previous Message | David G. Johnston | 2016-11-02 22:33:14 | Re: ERROR: out of shared memory |