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.92) (envelope-from ) id 1j9Ude-0004Op-La for pgsql-general@arkaria.postgresql.org; Wed, 04 Mar 2020 14:04:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j9Udd-0007x9-II for pgsql-general@arkaria.postgresql.org; Wed, 04 Mar 2020 14:04:41 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j9Udd-0007x2-96 for pgsql-general@lists.postgresql.org; Wed, 04 Mar 2020 14:04:41 +0000 Received: from relay10.mail.gandi.net ([217.70.178.230]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j9Uda-00058C-VY for pgsql-general@lists.postgresql.org; Wed, 04 Mar 2020 14:04:40 +0000 Received: from [10.8.8.2] (unknown [185.94.189.189]) (Authenticated sender: vik@postgresfriends.org) by relay10.mail.gandi.net (Postfix) with ESMTPSA id EC9E724001E; Wed, 4 Mar 2020 14:04:36 +0000 (UTC) Subject: Re: Calling a function from a rule? To: stan , pgsql-general@lists.postgresql.org References: <20200304130506.GA10957@panix.com> From: Vik Fearing Message-ID: <0a22aafe-9a3a-78b5-84e3-88c98512cba9@postgresfriends.org> Date: Wed, 4 Mar 2020 15:04:34 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <20200304130506.GA10957@panix.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 04/03/2020 14:05, stan wrote: > I am missing something about how to properly create a rule. What you are missing is that you should not ever use RULEs. > Thanks to the helpful folks on this list, I am looking a creating some > update able views. So, looks like I need to create a rule and a function > for this. Use an INSTEAD OF trigger on the view unless it's a simple view in which case it "just works". -- Vik Fearing