pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: Pg Hackers <pgsql-hackers@postgresql.org>
Subject: Re: pointless check in RelationBuildPartitionDesc
Date: Wed, 5 Sep 2018 10:05:57 -0300
Message-ID: <20180905130557.4spqs67cq7jdhoq4@alvherre.pgsql> (raw)
In-Reply-To: <5a60c5c4-6d19-4803-31d6-58e9dbeb0ac9@lab.ntt.co.jp>

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




view thread (11+ messages)

Message-ID: <20180905130557.4spqs67cq7jdhoq4@alvherre.pgsql>
Permalink:  ../20180905130557.4spqs67cq7jdhoq4@alvherre.pgsql/
Also on:    postgresql.org/message-id/20180905130557.4spqs67cq7jdhoq4@alvherre.pgsql

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: alvherre@2ndquadrant.com, Langote_Amit_f8@lab.ntt.co.jp, michael@paquier.xyz
  Subject: Re: pointless check in RelationBuildPartitionDesc
  In-Reply-To: <20180905130557.4spqs67cq7jdhoq4@alvherre.pgsql>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox