Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rrNHd-000FNf-D1 for pgsql-hackers@arkaria.postgresql.org; Mon, 01 Apr 2024 19:25:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rrNGd-0010G6-Dt for pgsql-hackers@arkaria.postgresql.org; Mon, 01 Apr 2024 19:24:28 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rrNGd-0010Fq-4S for pgsql-hackers@lists.postgresql.org; Mon, 01 Apr 2024 19:24:27 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rrNGX-000187-Dq for pgsql-hackers@lists.postgresql.org; Mon, 01 Apr 2024 19:24:26 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 431JOFmC1215957; Mon, 1 Apr 2024 15:24:15 -0400 From: Tom Lane To: Corey Huinker cc: Jeff Davis , Magnus Hagander , Stephen Frost , Ashutosh Bapat , Matthias van de Meent , Peter Smith , PostgreSQL Hackers , Tomas Vondra Subject: Re: Statistics Import and Export In-reply-to: References: <54f190b6c757da2a33cce811949e9dd9601fcba7.camel@j-davis.com> <1632327b74a734f8c434eb75e824160d2b06a697.camel@j-davis.com> <16412b8b7ae443cb7470006beff3011927048860.camel@j-davis.com> <1b1bd1ec39ab3de09a17bf7b241021067e5bd63c.camel@j-davis.com> <2bce855db8259c5672a09f863a307ca07b967b68.camel@j-davis.com> <5e94c358caedf2a231dd71624c3578db7227a265.camel@j-davis.com> <4afa70edab849ff1623! 8d1100b6652404e9a4d9d.camel@j-davis.com> <3df03aa65aa6ea3a76582e1a792e422dc5c32ad3.camel@j-davis.com> <718fa933c2c58d0ecc61995ab5c7ca1fe78d6369.camel@j-davis.com> <790773.1711910899@sss.pgh.pa.us> <8bc6ffe1e5abeac0fdde1a83d95409f0463af013.camel@j-davis.com> <1141637.1711994977@sss.pgh.pa.us> Comments: In-reply-to Corey Huinker message dated "Mon, 01 Apr 2024 14:53:43 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1215955.1711999455.1@sss.pgh.pa.us> Date: Mon, 01 Apr 2024 15:24:15 -0400 Message-ID: <1215956.1711999455@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Corey Huinker writes: > So what's the behavior when the user fails to supply a parameter that is > currently NOT NULL checked (example: avg_witdth)? Is that a WARN-and-exit? I still think that we could just declare the function strict, if we use the variadic-any approach. Passing a null in any position is indisputable caller error. However, if you're allergic to silently doing nothing in such a case, we could have pg_set_attribute_stats check each argument and throw an error. (Or warn and keep going; but according to the design principle I posited earlier, this'd be the sort of thing we don't need to tolerate.) regards, tom lane