Thread: Using placeholders when creating a materialized view

Using placeholders when creating a materialized view

From
Mitar
Date:
Hi!

Is it possible to use placeholders and provide values to the query
when creating a materialized view? It looks like direct passing of
values to the query is not possible and I have to encode them?


Mitar

-- 
http://mitar.tnode.com/
https://twitter.com/mitar_m


Re: Using placeholders when creating a materialized view

From
Adrian Klaver
Date:
On 12/29/18 12:07 AM, Mitar wrote:
> Hi!
> 
> Is it possible to use placeholders and provide values to the query
> when creating a materialized view? It looks like direct passing of
> values to the query is not possible and I have to encode them?

The only way I could see to do that is using dynamic SQL in a function:

https://www.postgresql.org/docs/11/plpgsql-statements.html#PLPGSQL-STATEMENTS-EXECUTING-DYN

Or use something like pl/pythonu.


> 
> 
> Mitar
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com