Re: Using placeholders when creating a materialized view

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Mitar <mmitar(at)gmail(dot)com>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Using placeholders when creating a materialized view
Date: 2018-12-29 20:47:17
Message-ID: f97a83c0-a037-5cb8-1e15-4926bedba30d@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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(dot)klaver(at)aklaver(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2018-12-29 21:01:47 Re: In which session context is a trigger run?
Previous Message Adrian Klaver 2018-12-29 20:38:04 Re: getting pg_basebackup to use remote destination