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 1h4xPF-0005Kx-DX for pgsql-general@arkaria.postgresql.org; Sat, 16 Mar 2019 00:42:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h4xOF-0004RR-Se for pgsql-general@arkaria.postgresql.org; Sat, 16 Mar 2019 00:41:31 +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 1h4xOE-0004RJ-Qg for pgsql-general@lists.postgresql.org; Sat, 16 Mar 2019 00:41:31 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h4xO7-0005Js-Ha for pgsql-general@lists.postgresql.org; Sat, 16 Mar 2019 00:41:29 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id C85D521FEE; Fri, 15 Mar 2019 20:41:22 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Fri, 15 Mar 2019 20:41:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm2; bh=H r/CMgPoQ1bjFoymcCdT1rHvy8TPdOcDtqQPLbEpqlw=; b=DTVvfyqI65a4/fIPq 1KVNjlU+f304FvXf/OKXANv1W54MYOaIS6guoV31GWn9sDlsGuPd6wKcgZZ7HvAc ty0+xVe2+D4iZZY7DV+0lYAQNTxiYH3UD6D1faPj80NVBWOwcQ0vORIwYOsf//Sy fPOr+PbsWb0JDi0omD2h7t8Udiv73SHnv+jaJz358oKCYT5m++GQN9eW98GqZcpQ 5X3fWV0uTaAAhviPgjSvnYwvfZtCHvtSHPVq0zrBZbZbQKPs81fS1yTHmsuang5C jtGh3uqGQ60qwzziQGIOjmvkplXBj6DqnqpEs9gHZ5KKgQlyIhCvM+UpUXc5a0NT 5doOg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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=fm2; bh=Hr/CMgPoQ1bjFoymcCdT1rHvy8TPdOcDtqQPLbEpq lw=; b=Pp+wZ+PuTdBRQkaszOsBtNEJChBYVgKHcmKjHJlqB/7GsxwUont1AGJ9l mbgtLORwe4IOFT85dKi5S4A0zMzqkcqZjz7vsRGTa045rj73p4aelVcmnyhEcjvl WmSVtcTgQk0LIYAk+6Pug0tATwrWQOWrD7kAmnW/2IfOBH7PZUK5TLtoIiudpdBg eoF16xWLGON31Y5XC208eCRNe+mglbh52BR2yYnqIElU6DAm+0ZSOOGdBA0TXv8J YawNCtV2HG0mCwkmEXJlHcqFOO0Ri66CwZ1v9ovf4q+f7C/1gK1kZdc8KN1RCKTq ACGogaNP0XltnjG3lr8jxYroFq9vw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrheeigdefgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefuvfhfhffkffgfgggjtgfgsehtkeertddtfeejnecuhfhrohhmpeetughrihgr nhcumfhlrghvvghruceorggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh eqnecuffhomhgrihhnpehpohhsthhgrhgvshhqlhdrohhrghenucfkphepjedurddvuddv rdduhedtrddvtddvnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrughrihgrnhdrkhhlrg hvvghrsegrkhhlrghvvghrrdgtohhmnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from [192.168.1.4] (unknown [71.212.150.202]) by mail.messagingengine.com (Postfix) with ESMTPA id A201010311; Fri, 15 Mar 2019 20:41:21 -0400 (EDT) Subject: Re: Conditional INSERT To: Ken Tanzer Cc: basti , "pgsql-generallists.postgresql.org" References: <68951fae-3281-c9ad-09b7-205e0bb1c5ae@unix-solution.de> <1ebb57da-c34b-6581-ea33-bdf78f6990f8@unix-solution.de> <53dc55ae-506f-2aed-ea80-50f0978837ab@aklaver.com> From: Adrian Klaver Message-ID: <18a75d30-85f4-becd-7a78-43b5315fd298@aklaver.com> Date: Fri, 15 Mar 2019 17:41:20 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 3/15/19 5:19 PM, Ken Tanzer wrote: > > > On Fri, Mar 15, 2019 at 4:42 PM Adrian Klaver > wrote: > OK, and thanks for the info. I've gleaned that rules are not > "deprecated" in the sense that they are slated for removal, but they are > rather discouraged.  Since that's the case, wouldn't it make sense to > warn users about this?  That might keep them away from rules, and ease > any eventual deprecation/transition issues you might have by lowering > the number of "rules" in the wild. Well then there is this section: https://www.postgresql.org/docs/11/rules-views.html So as was mentioned in thread I posted, until someone comes up with a replacement they are not going away. > > In the section on "Rules vs. Triggers" (41.7), it doesn't even hint at > this, and even says: > > /"For the things that can be implemented by both, which is best depends > on the usage of the database." > / > > There _is_ a nice CAUTION box in 41.4 ("Rules on Insert, Update and > Delete").  I would suggest that something like that should go into Rules > vs. Triggers, and then have a short caution box at the top of perhaps > every Rule page (or at the very least for "CREATE RULE") that says > something like "Rules are discouraged.  You may be better off with > Triggers instead.  See ." > > Just my two cents, but that might help more people be aware of the issue > and avoid rules altogether. I thought I remember there being something like in a older version of the docs. I can't find it now, so it might be just my mind playing tricks on me. > > Cheers, > Ken > -- Adrian Klaver adrian.klaver@aklaver.com