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 1fxXVd-0000ZG-Ov for pgsql-hackers@arkaria.postgresql.org; Wed, 05 Sep 2018 13:06:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fxXVc-0008Ui-Dk for pgsql-hackers@arkaria.postgresql.org; Wed, 05 Sep 2018 13:06:12 +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 1fxXVc-0008UZ-3p for pgsql-hackers@lists.postgresql.org; Wed, 05 Sep 2018 13:06:12 +0000 Received: from mail-qt0-x241.google.com ([2607:f8b0:400d:c0d::241]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1fxXVR-00047S-UM for pgsql-hackers@postgresql.org; Wed, 05 Sep 2018 13:06:11 +0000 Received: by mail-qt0-x241.google.com with SMTP id g53-v6so7876627qtg.10 for ; Wed, 05 Sep 2018 06:06:01 -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=6+TeaByfMUT1KDuxaAhqcN98SGbnvgdPGqTqBqW0tK0=; b=aGQEvscHe8IdGPeh6aV9+ixcI8uTntfn/ca9dAM37kvcsBrivkHEsDxa4ZWaeyBPae kZXWZT5W/HxhhCOpIvxIgwKCvlcNWNPuNC56w6W0m/wLpuh2wQPBRK6DYrCjklrw5uu3 2M56yxcK0drKgc/rcH76Gl3NJgmHpuz7OUz3FiLahzivhcRmq5YdSaDdU7EvWB5GMxI7 fRpi2bDCGB0aiv30jgwh7dxbphXMWXCzCV3VZOg/j7kj7ZeZU+e08lwcmpjO2bLXAjEO hTkh/+RqqrylHONyCTxM50/jwX0IUi7aySFoPX4Pze3whh6INHV2Oo96+uOXzeWw1/Sc 9evw== 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=6+TeaByfMUT1KDuxaAhqcN98SGbnvgdPGqTqBqW0tK0=; b=jg66CO0bMML8JO/ZTZ9oIj3l/pmajNn/eofiaK/5BQssSA251TXR8oEzbHlEXoIPqp EkkTgBVm0DHPhLTq+amWd1zmv38pKIREelVLtD+Z1iYEdRvsEcT7STlYFFXhNE/jUvdG 2dEkkBCyPt2YCcFH/MaH7xz0Aba7JH3abVX7qbpMQ921DwqdozrJlBt0e2TWjbeNU9Aa RWYdIfMR7J1W0jQztA9zH40fCdqiJD7WlI1PlQbND5UVRznODcceXZ4j6RI+Xm6OaEEV 7WTTpAc9aIExnADbq3Xz/L8cO1TAAopFNUAucIOp1JsWbiWMEZQjGiyfx/znAbYVe56A FNNQ== X-Gm-Message-State: APzg51BpEq3hlvTHg1x3MljM3x29gv0aGB3HJNS0MczA/8XkJBRNQzOS fHTGZD0IQjxD1kTjiIx53259/A== X-Google-Smtp-Source: ANB0VdYzfl0udhGVEa0vu3RHFMHcSfT/M1Wb1cNr3hqVO6ab5lKibf3MQTetqffN59FcPnqi6oncKQ== X-Received: by 2002:a0c:983d:: with SMTP id c58-v6mr32678689qvd.221.1536152759815; Wed, 05 Sep 2018 06:05:59 -0700 (PDT) Received: from alvin.alvh.no-ip.org ([190.121.29.3]) by smtp.gmail.com with ESMTPSA id x32-v6sm1183116qtb.70.2018.09.05.06.05.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 05 Sep 2018 06:05:59 -0700 (PDT) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id A6DD896A; Wed, 5 Sep 2018 10:05:57 -0300 (-03) Date: Wed, 5 Sep 2018 10:05:57 -0300 From: Alvaro Herrera To: Amit Langote Cc: Michael Paquier , Pg Hackers Subject: Re: pointless check in RelationBuildPartitionDesc Message-ID: <20180905130557.4spqs67cq7jdhoq4@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <5a60c5c4-6d19-4803-31d6-58e9dbeb0ac9@lab.ntt.co.jp> 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-05, Amit Langote wrote: > On 2018/09/05 1:50, Alvaro Herrera wrote: > > Proposed patch. Checking isnull in a elog(ERROR) is important, because > > the column is not marked NOT NULL. This is not true for other columns > > where we simply do Assert(!isnull). > > Looks good. Thanks for taking care of other sites as well. > > @@ -14705,7 +14705,9 @@ ATExecDetachPartition(Relation rel, RangeVar *name) > > (void) SysCacheGetAttr(RELOID, tuple, Anum_pg_class_relpartbound, > &isnull); > - Assert(!isnull); > + if (isnull) > + elog(ERROR, "null relpartbound for relation %u", > + RelationGetRelid(partRel)); > > In retrospect, I'm not sure why this piece of code is here at all; maybe > just remove the SycCacheGetAttr and Assert? Yeah, good idea, will do. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services