Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oTlIt-0006Cu-1k for pgsql-general@arkaria.postgresql.org; Thu, 01 Sep 2022 14:36:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oTlIr-0000sH-Om for pgsql-general@arkaria.postgresql.org; Thu, 01 Sep 2022 14:36:21 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oTlIr-0000s8-CN for pgsql-general@lists.postgresql.org; Thu, 01 Sep 2022 14:36:21 +0000 Received: from mail-oa1-x33.google.com ([2001:4860:4864:20::33]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oTlIp-0000NO-60 for pgsql-general@lists.postgresql.org; Thu, 01 Sep 2022 14:36:20 +0000 Received: by mail-oa1-x33.google.com with SMTP id 586e51a60fabf-1225219ee46so7324954fac.2 for ; Thu, 01 Sep 2022 07:36:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date; bh=3tcPUajwHB8czAqGs7+tK/9ZdM/dKtTffS3rNN7aXmY=; b=m4NOEmFgHLmVfFdbpQoX02Hf827rMkh7sW1zeHQF+7eZ79sm4HC/rNG0ZSMlWuMwZ3 O0r/ZIxmfeMGES++eHnG8Ec30FF7fg5rrZala4PiY4vR5p/bcN1ifmeQGodq7sUZlVhk 7A5yLwBRNr0+53SjE1LMjHQyTyVGUQzLpHRTB/jGIdofkT0px/IlN8O/Wo0hXtZARMnR a3/0tbQHLW/DpBCw7141ZdakW9gdjw35/kbcju/lAaspRcQCb8jGADp81vECMNAzZKe9 ssVj+J5hxnb4CTB30h0MKMzxnQMAFf6wpFHuwfF91uORxEUBhgpP51E9x2lyEvLIaJrJ VWIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date; bh=3tcPUajwHB8czAqGs7+tK/9ZdM/dKtTffS3rNN7aXmY=; b=rCpsMtEawG3Ih/CjHQJA2GRmpsgWe9jXP/SrhE/JoZOZKqEffg/QQARtwlBAl4lNFP t9vxnsBu2mMms1OHgwUVrn+1TvmslzzJofBET84+pA+cgfASlxhgiv/5rOY1F8BjOJHE miCShOEeIi+KBYA72fv3o60msV5MUsFx2rPVW2LN9LcQzVYQwfbz41CwBCiY6Bqy9dDo GsnoI3n+VknCdcpwDK0OtAdYu0YHWM0Bfgp5xEr/zHKq+trkE2ZIC95d7HeBJgINebnp 91IfixjoI4NKt2KTi1aGe5N9ELsDVX3bbMcthXiKL3p80WAnnaJhFpD8OCrMx/bCuMQC 8m1g== X-Gm-Message-State: ACgBeo0UfUDsQPD9eyXCxB2V16w8KKnJS8zUNGOpMZTpzSVHvFRpu8tr jCZ+xOAIbjedOFApMsGq9+ulcFqINhU= X-Google-Smtp-Source: AA6agR7Z4/0w9ryu6x/VixeqZRTPlxL3mWtnwUUgwU6zeAs0yzcP7bkNXanBuPNRBHZ3k9IFRjDLVA== X-Received: by 2002:a54:4014:0:b0:343:3683:1b60 with SMTP id x20-20020a544014000000b0034336831b60mr3433893oie.203.1662042976834; Thu, 01 Sep 2022 07:36:16 -0700 (PDT) Received: from [192.168.88.10] (ip68-11-68-85.no.no.cox.net. [68.11.68.85]) by smtp.googlemail.com with ESMTPSA id g17-20020a544f91000000b0033a11fcb23bsm8683839oiy.27.2022.09.01.07.36.15 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 01 Sep 2022 07:36:16 -0700 (PDT) Message-ID: <1993dc39-b60a-cdd8-e8bb-a6cb261185d2@gmail.com> Date: Thu, 1 Sep 2022 09:36:14 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: View definition changes after reloading pg_dump export Content-Language: en-US To: pgsql-general@lists.postgresql.org References: <58cef826-706a-3838-3ce3-e6011c2ccd76@exxellence.nl> <402822.1662041327@sss.pgh.pa.us> From: Ron In-Reply-To: <402822.1662041327@sss.pgh.pa.us> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 9/1/22 09:08, Tom Lane wrote: > Wesley Schwengle writes: >> There is a view that we create and it uses a function and the view >> definition changes between runs. I'm not sure why this is happening, >> does someone know? > The core reason for the discrepancy is that the parser inserts > implicit coercion steps into your initial, not-very-consistently-typed > query; but the view-dumping logic (ruleutils.c) tends to display > those steps as explicit coercions. Formally speaking it shouldn't > do that, because the parser may act differently depending on whether > a cast is explicitly present, as indeed you see here. But if we don't > write the coercions explicitly then there is a risk of the reloaded view > being interpreted differently than it was before (perhaps because there > are more or different overloaded functions/operators available at reload > time). So the dumping logic is kind of between a rock and a hard place. > Our experience has been that printing the coercions explicitly causes > fewer problems than not doing so, so that's what it does. > > regards, tom lane > > "foo.baz::character varying::text" seems pretty odd. -- Angular momentum makes the world go 'round.