Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gdLW2-0003d8-6z for pgsql-general@arkaria.postgresql.org; Sat, 29 Dec 2018 20:47:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gdLVz-0004Y0-Vv for pgsql-general@arkaria.postgresql.org; Sat, 29 Dec 2018 20:47:23 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gdLVz-0004Xs-Ko for pgsql-general@lists.postgresql.org; Sat, 29 Dec 2018 20:47:23 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gdLVw-0001sk-23 for pgsql-general@lists.postgresql.org; Sat, 29 Dec 2018 20:47:22 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 0100521AA2; Sat, 29 Dec 2018 15:47:19 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Sat, 29 Dec 2018 15:47:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm1; bh=T Kv/t7OvMmYHCn4CWnbbe2VQF2AO7QdJ4KoG7B0RB+g=; b=StkQEg12TX1XAGf40 CHzmhIybMl6qv3fXBO169m2Lp/d8boJP4WvZlwQfRPpHbQXLBybjmzYPWZucmfmg nJm+JEjFg9bCzFxFlb5VhT/HrlPteWB/TauVAOwgZ/ji8BKZJO9O1gfQsmb1Se1Q yLvyZsn9ry4qcVia6mmGLdsdmAEry3gZYYJZF2eAklmFvc7TXgIKE8BUbAUw/XSs PKz3VAw3wNj4+lLe1j0ZfyzeJ0eW3Ej7RrUuV0bLneWeWzw/tsg6U5HIZaTaFD+N cscKTro+VYz2Ogn2WsREsto+VqrD/BQSIpVkWQiZlfbPgiY5k6tkyDm5yOKVFT3K 7Uamw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=TKv/t7OvMmYHCn4CWnbbe2VQF2AO7QdJ4KoG7B0RB +g=; b=WqgFjp7pTbvPTkrkSoRRKAvQ+EZ5HZtXL9HFPXJeLIDJsgWJfxXqZsZ7F xgiNtxzGfJg6IHMQz6opZMvxuekRNZ+7I2JWLzDMromCnn/Rj+WAvfIopQiiEIuU I1zs2Zii4ZziONChL3FwdZIO/TWQbwnJ5phLP8j7CyhELpt9TyJWzKTGcFeskHOT QmfNM3MSeSF+qQ1hVWusGujC8Q6CmTbpnM83ZxPJBQ2kNMCR3CallJhrVRsM9mzt 1ObMUHQ6deG2QI2AezQ2nunYXLiifx6ImcztDoM81Wg8EFrggd+ApLPuHx8vrjEq qTj2DoUHIXttrqXmVb4oQrqezWFgA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledrtdekgddugeefucdltddurdegtdekrddttd dmucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhht necuuegrihhlohhuthemuceftddtnecunecujfgurhepuffvfhfhkffffgggjggtgfesth ejredttdefjeenucfhrhhomheptegurhhirghnucfmlhgrvhgvrhcuoegrughrihgrnhdr khhlrghvvghrsegrkhhlrghvvghrrdgtohhmqeenucffohhmrghinhepphhoshhtghhrvg hsqhhlrdhorhhgnecukfhppeejuddrvdduvddrudefgedrfeenucfrrghrrghmpehmrghi lhhfrhhomheprggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomhenucevlh hushhtvghrufhiiigvpedt X-ME-Proxy: Received: from [192.168.1.2] (unknown [71.212.134.3]) by mail.messagingengine.com (Postfix) with ESMTPA id 37909E464F; Sat, 29 Dec 2018 15:47:18 -0500 (EST) Subject: Re: Using placeholders when creating a materialized view To: Mitar , pgsql-general@lists.postgresql.org References: From: Adrian Klaver Message-ID: Date: Sat, 29 Dec 2018 12:47:17 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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