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 1lZJuC-0001a6-7N for pgsql-hackers@arkaria.postgresql.org; Wed, 21 Apr 2021 20:57:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lZJuB-0005aP-4J for pgsql-hackers@arkaria.postgresql.org; Wed, 21 Apr 2021 20:57:03 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lZJuA-0005a8-Tv for pgsql-hackers@lists.postgresql.org; Wed, 21 Apr 2021 20:57:02 +0000 Received: from wforward4-smtp.messagingengine.com ([64.147.123.34]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lZJu7-0004eP-Mv for pgsql-hackers@lists.postgresql.org; Wed, 21 Apr 2021 20:57:01 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailforward.west.internal (Postfix) with ESMTP id C93B818AD for ; Wed, 21 Apr 2021 16:56:57 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Wed, 21 Apr 2021 16:56:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=t669qr f8j6133g8VsAiAbeiDYpdC+uO+5u+USCRsyaA=; b=kE4C0SfHk3Lt8K9KWKOQEp NLGbO0JeKwmMl6zZrkDPShI+qo23YR+zffWoCMRVG6rEG0pUfdXYymekiOhI+eAN NV9MzVQh8k+yqWXrKxZ0sI/HII0b3MAuFWVNjNaYms9XCQI6NF4GHLlk9fYqYqPG GRRg/aCJ5NlsEu7zmaNN+4rjiK4dPM5ladb9YB6LDEvRamJuKXZ88hQSsJR6i15r a7oFIelyUQIWOk4g2yTcZTrt4Qb1HtuQLrYpyU1V1TibdN+/SVRHit+JuK4/18SR iluu0PhtYBEBfo4wh/NwV244oY+9SrWx/+GPEctP6HumngmmsOJurUJ8p8Scca5A == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvddtkedgudehjecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhephffuvffkffgfgggtgfesthejre dttdefjeenucfhrhhomheprfgvthgvrhcugfhishgvnhhtrhgruhhtuceophgvthgvrhdr vghishgvnhhtrhgruhhtsegvnhhtvghrphhrihhsvggusgdrtghomheqnecuggftrfgrth htvghrnhepieeiveejleeihefgkedtheetheehueevgffgieevfffghfehveeghfdvgeef ledvnecukfhppeelfedrvddtvddrvdehfedrudegfeenucevlhhushhtvghrufhiiigvpe dtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehpvghtvghrrdgvihhsvghnthhrrghuthes vghnthgvrhhprhhishgvuggsrdgtohhm X-ME-Proxy: Received: from laptop206oxuk.local (p5dcafd8f.dip0.t-ipconnect.de [93.202.253.143]) by mail.messagingengine.com (Postfix) with ESMTPA id 7310B24005B for ; Wed, 21 Apr 2021 16:56:56 -0400 (EDT) From: Peter Eisentraut Subject: multirange constructor strictness To: PostgreSQL Developers Message-ID: <0f783a96-8d67-9e71-996b-f34a7352eeef@enterprisedb.com> Date: Wed, 21 Apr 2021 22:56:54 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.9.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk The multirange constructors created in makeMultirangeConstructors() are: multirange_constructor0 -> not strict multirange_constructor1 -> strict multirange_constructor2 -> not strict And both multirange_constructor1 and multirange_constructor2 contain code like /* * These checks should be guaranteed by our signature, but let's do them * just in case. */ if (PG_ARGISNULL(0)) ereport(ERROR, (errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED), errmsg("multirange values cannot contain NULL members"))); In case of multirange_constructor2 the "should be guaranteed" comment is not actually true right now. In case of multirange_constructor1, maybe this should be downgraded to an elog or assert or just removed. Is there a reason why we can't make them all three strict or all not strict? (Obviously, it doesn't matter for multirange_constructor0.) Is the fact that multirange_constructor2 is variadic the issue? Maybe at least some more comments would be helpful.