Re: create temp view from function inside plpgsql function.

From: David Johnston <polobo(at)yahoo(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: create temp view from function inside plpgsql function.
Date: 2014-04-08 22:31:03
Message-ID: 1396996263201-5799286.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Re-posting, see quote

David Johnston wrote
>
> Pavel Stehule wrote
>> 2014-04-04 14:16 GMT+02:00 Tjibbe &lt;

>> tjibbe@

>> &gt;:
>>
>>> Thanks that works!
>>>
>>> Little bit confusing ERROR.
>>>
>>
>> yes, it could be - but hard to fix it, because it is based on cooperation
>> two worlds - plpgsql and SQL - and it is sometimes not simple.
>>
>> When you understand how plpgsql interpret use variables in SQL queries,
>> then you understand to this message. Simple rule - never use plpgsql
>> variables in DDL
> Yet, IIRC, if you had done a CREATE TEMP TABLE instead of view the query
> would have worked just fine. The issue is with CREATE VIEW specifically
> because the query itself is part of the final content whereas for CREATE
> TABLE the query is only used to generate the data which is then stored.
>
> David J.

--
View this message in context: http://postgresql.1045698.n5.nabble.com/create-temp-view-from-function-inside-plpgsql-function-tp5798658p5799286.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Steve Kehlet 2014-04-08 23:08:45 Re: is there a way to firmly cap postgres worker memory consumption?
Previous Message David Johnston 2014-04-08 22:21:17 Re: check constraint question