Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fxAnz-0002Do-64 for pgsql-hackers@arkaria.postgresql.org; Tue, 04 Sep 2018 12:51:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fxAnw-0003XH-D7 for pgsql-hackers@arkaria.postgresql.org; Tue, 04 Sep 2018 12:51:36 +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_SHA384:256) (Exim 4.89) (envelope-from ) id 1fxAnw-0003XA-11 for pgsql-hackers@lists.postgresql.org; Tue, 04 Sep 2018 12:51:36 +0000 Received: from mail-qt0-x242.google.com ([2607:f8b0:400d:c0d::242]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1fxAns-0004eH-4I for pgsql-hackers@postgresql.org; Tue, 04 Sep 2018 12:51:35 +0000 Received: by mail-qt0-x242.google.com with SMTP id o15-v6so3740407qtk.6 for ; Tue, 04 Sep 2018 05:51:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=/JutsgQIGYUu2GmuXUNdJxjIB22IgOJhDhNEmwNTNUo=; b=tCArPNHVMCs0AnXnkvOJWe9sZF/Lya6o3bhDPWj5zkABciNAUQP5/R8aQa1RC+YSRQ EUSnlrvjvjDe/JE14dQvH4ij3794+uM7/zOvHzHC9tE87l+sm1xyRdYbSeHGIfehzQ9P ylbcbENbrPYAnjluhVo5oAxIqWY/G6JbW+HKTiaBO4mL7jX42kgymiMD0hoyQ10uCScv AnNTmq5W5LDrwS/LmIwZEnvQSxwcSMEFKI4FTOu44JzerYPTpW3tewfLc3XJpiM5G+9U lbPG/vzf7zvZQclA6zUtIX9vqA4+IU3D4K+LmCWyiXBGm4KyMxvCmbUfo7b7wPT5MMp3 7K/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=/JutsgQIGYUu2GmuXUNdJxjIB22IgOJhDhNEmwNTNUo=; b=m3kblmouie+OWOCoFuOI7Z3SdIgzTcOk4p3MM3L3jZJFjaHKRmQ+Thql5vaXSKP3Dx oGykd4Fx7YpZ8oObw0wnwivwj1zTNwe1zb1HpUgJGZo3ufvFvM0TsNRh5zl538EExA+p qya60s+YmkChsWaMp0vQGtCW0d4i+lmzRp1VPbA7Xm07631HL+rYp/lZ6ZkQrkuhVU+w x0HjuYKuaZltipXkslv6BJQuTdHdjdoiMiFYjg0m8BQS0bEEbMTDH5E8FAwSK+mYnXFO HpaFHiaTe9yfIcUWlRByXhv54aEQr3/KSE6TkVDK19SBnf7HGJPoaGxHSFdhAUcol+j9 dxiw== X-Gm-Message-State: APzg51CVsO6T3KMa9oCf3WhPLHDnDVv90jG/NzXRXeq/QmD87GDrrarP 5KYBHorU4D+bCVwvT4hHeG5nbQ== X-Google-Smtp-Source: ANB0Vdb+0VvT32BV0pMJe2SgZY19shLzDcvzz1HOyqQMaJ0bNdqiKajJVR6WD8N0zxVfCiO+ylO+WA== X-Received: by 2002:aed:3e17:: with SMTP id l23-v6mr31071628qtf.52.1536065490418; Tue, 04 Sep 2018 05:51:30 -0700 (PDT) Received: from alvin.alvh.no-ip.org ([190.121.29.3]) by smtp.gmail.com with ESMTPSA id f25-v6sm12779435qkh.13.2018.09.04.05.51.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 04 Sep 2018 05:51:29 -0700 (PDT) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id 3C64A96A; Tue, 4 Sep 2018 09:51:28 -0300 (-03) Date: Tue, 4 Sep 2018 09:51:28 -0300 From: Alvaro Herrera To: Amit Langote Cc: Michael Paquier , Pg Hackers Subject: Re: pointless check in RelationBuildPartitionDesc Message-ID: <20180904125128.ntliwrygsylaar4b@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20170306-137-4415bd-dirty (1.8.0) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2018-Sep-04, Amit Langote wrote: > On 2018/09/04 13:08, Alvaro Herrera wrote: > > I think it'd be pointless noise. If we really want to protect against > > that, I think we should promote the Assert for relpartbound's isnull > > flag into an if test. > > So that we can elog(ERROR, ...) if isnull is true? If so, I agree, > because that's what should've been done here anyway (for a value read from > the disk that is). Yes. I wonder now what's the value of using an Assert for this, BTW: if those are enabled, then we'll crash saying "this column is null and shouldn't!". If they are disabled, we'll instead crash (possibly in production) trying to decode the field. What was achieved? With an elog(ERROR) the reaction is the expected one: the current transaction is aborted, but the server continues to run. > I think we should check relispartition then too. Well, we don't check every single catalog flag in every possible code path just to ensure it's sane. I don't see any reason to do differently here. We rely heavily on the catalog contents to be correct, and install defenses against user-induced corruption that would cause us to crash; but going much further than that would be excessive IMO. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services