Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iAauy-0003tZ-KZ for pgsql-general@arkaria.postgresql.org; Wed, 18 Sep 2019 14:26:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iAauw-00007a-Kd for pgsql-general@arkaria.postgresql.org; Wed, 18 Sep 2019 14:26:50 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iAauw-00007H-7T for pgsql-general@lists.postgresql.org; Wed, 18 Sep 2019 14:26:50 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iAauu-0002Mk-1e for pgsql-general@lists.postgresql.org; Wed, 18 Sep 2019 14:26:49 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x8IEQkTq024379; Wed, 18 Sep 2019 10:26:46 -0400 From: Tom Lane To: Paul A Jungwirth cc: pgsql-general@lists.postgresql.org Subject: Re: When does Postgres use binary I/O? In-reply-to: References: Comments: In-reply-to Paul A Jungwirth message dated "Tue, 17 Sep 2019 22:10:54 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <24377.1568816806.1@sss.pgh.pa.us> Date: Wed, 18 Sep 2019 10:26:46 -0400 Message-ID: <24378.1568816806@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Paul A Jungwirth writes: > I've read the docs at [1] and also this interesting recent post about > adding binary I/O to the hashtypes extension. I wrote send & recv > functions for my new multirange types, but I'm not sure how to test > them. After running installcheck or installcheck-world, the code > coverage report says they aren't tested, nor are the send/recv > functions for ranges or arrays. When does Postgres actually use these > functions? Is there a good way to test them? The core regression tests don't systematically exercise binary I/O, and they certainly wouldn't magically cover a new type they didn't use to. You'd need to add test case(s). Likely it'd be good to have some more consistent approach to testing that ... right now it's not even very obvious where is a good place to add such tests. I do see a small test in src/test/regress/input/misc.source (COPY BINARY stud_emp), but that solution doesn't scale easily because of its dependence on absolute file pathnames. regards, tom lane