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 1rC4Ly-00Dk7s-5r for pgsql-hackers@arkaria.postgresql.org; Sat, 09 Dec 2023 20:55:14 +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 1rC4Lw-003DwI-BZ for pgsql-hackers@arkaria.postgresql.org; Sat, 09 Dec 2023 20:55:12 +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 1rC4Lw-003Dw9-1t for pgsql-hackers@lists.postgresql.org; Sat, 09 Dec 2023 20:55:12 +0000 Received: from mail.clear-code.com ([2401:2500:102:3039:153:126:206:245]) by makus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rC4Lo-009cQw-7T for pgsql-hackers@postgresql.org; Sat, 09 Dec 2023 20:55:10 +0000 Received: from localhost (unknown [IPv6:2404:7a80:89c1:1200:1653:202c:ea56:2daf]) by mail.clear-code.com (Postfix) with ESMTPSA id D93706FE592; Sun, 10 Dec 2023 05:54:56 +0900 (JST) DKIM-Filter: OpenDKIM Filter v2.11.0 mail.clear-code.com D93706FE592 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=clear-code.com; s=default; t=1702155297; bh=sY2aKxyqBvG77SqSjSNpCwfbhEUFBKu+xv4IusTIfdM=; h=Date:To:Cc:Subject:From:In-Reply-To:References:From; b=r5WL9nKT/lZVyBA7OnltPN/pdSjd/Qn+ZYTSZ3QwRNWb3f2Dk6o87a7mHQ8TCiUrG JDttex0PdYgAQHkaqwY3MM/Auu+OPPS7EdyJgnae3WNxqNjyPK365uG+VWepE7npsu U7PUHw1eaDXXWxk3I8vZrdh0JNNibugzilzDfnac= Date: Sun, 10 Dec 2023 05:54:56 +0900 (JST) Message-Id: <20231210.055456.1961426152912458334.kou@clear-code.com> To: sawada.mshk@gmail.com Cc: michael@paquier.xyz, zhjwpku@gmail.com, andrew@dunslane.net, nathandbossart@gmail.com, pgsql-hackers@postgresql.org Subject: Re: Make COPY format extendable: Extract COPY TO format implementations From: Sutou Kouhei In-Reply-To: References: X-Mailer: Mew version 6.8 on Emacs 29.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: D93706FE592 X-Rspamd-Server: mail.clear-code.com X-Spamd-Result: default: False [2.90 / 999.00]; SUSPICIOUS_RECIPS(1.50)[]; MID_CONTAINS_FROM(1.00)[]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:2518, ipnet:2404:7a80::/29, country:JP]; RCVD_COUNT_ZERO(0.00)[0]; FREEMAIL_TO(0.00)[gmail.com]; TAGGED_RCPT(0.00)[]; ARC_NA(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; URIBL_BLOCKED(0.00)[localhost:helo]; FROM_HAS_DN(0.00)[]; FREEMAIL_CC(0.00)[paquier.xyz,gmail.com,dunslane.net,postgresql.org]; RCPT_COUNT_FIVE(0.00)[6]; FROM_EQ_ENVFROM(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; SURBL_MULTI_FAIL(0.00)[localhost:server fail] X-Rspamd-Action: no action List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, In "Re: Make COPY format extendable: Extract COPY TO format implementations" on Fri, 8 Dec 2023 15:42:06 +0900, Masahiko Sawada wrote: > So a custom COPY extension would not be able to define SQL functions > just like arrow(internal) for example. We might need to define a rule > like the function returning copy_in/out_handler must be defined as > _to(internal) and _from(internal). We may not need to add "_to"/"_from" suffix by checking both of argument type and return type. Because we use different return type for copy_in/out_handler. But the current LookupFuncName() family doesn't check return type. If we use this approach, we need to improve the current LookupFuncName() family too. Thanks, -- kou