pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Mitar <mmitar@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Using placeholders when creating a materialized view
Date: Sat, 29 Dec 2018 12:47:17 -0800
Message-ID: <f97a83c0-a037-5cb8-1e15-4926bedba30d@aklaver.com> (raw)
In-Reply-To: <CAKLmikOrGwwcF4JNNXeG8r+7N3SUrfcEYZQbZ2ytDs4=RAuaPg@mail.gmail.com>
References: <CAKLmikOrGwwcF4JNNXeG8r+7N3SUrfcEYZQbZ2ytDs4=RAuaPg@mail.gmail.com>

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




view thread (2+ messages)

Message-ID: <f97a83c0-a037-5cb8-1e15-4926bedba30d@aklaver.com>
Permalink:  ../f97a83c0-a037-5cb8-1e15-4926bedba30d@aklaver.com/
Also on:    postgresql.org/message-id/f97a83c0-a037-5cb8-1e15-4926bedba30d@aklaver.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: adrian.klaver@aklaver.com, mmitar@gmail.com
  Subject: Re: Using placeholders when creating a materialized view
  In-Reply-To: <f97a83c0-a037-5cb8-1e15-4926bedba30d@aklaver.com>
  References: <CAKLmikOrGwwcF4JNNXeG8r+7N3SUrfcEYZQbZ2ytDs4=RAuaPg@mail.gmail.com> <f97a83c0-a037-5cb8-1e15-4926bedba30d@aklaver.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox