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 1tujbk-00B8Sg-9k for pgsql-hackers@arkaria.postgresql.org; Wed, 19 Mar 2025 02:56:41 +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 1tujbi-00B5Pv-Ab for pgsql-hackers@arkaria.postgresql.org; Wed, 19 Mar 2025 02:56:38 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tujbh-00B5OW-3Q for pgsql-hackers@lists.postgresql.org; Wed, 19 Mar 2025 02:56:37 +0000 Received: from mail.clear-code.com ([2401:2500:102:3037:153:126:203:179]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tujbZ-003gDW-0K for pgsql-hackers@postgresql.org; Wed, 19 Mar 2025 02:56:35 +0000 Received: from localhost (unknown [IPv6:2404:7a80:9f01:f500:acd0:2aa3:7b08:7206]) by mail.clear-code.com (Postfix) with ESMTPSA id 31F9F68925D; Wed, 19 Mar 2025 11:56:19 +0900 (JST) DKIM-Filter: OpenDKIM Filter v2.11.0 mail.clear-code.com 31F9F68925D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=clear-code.com; s=default; t=1742352979; bh=bc56UoBX3kHaWz/TXg1bk4hj/Kp5LnD+mX66TnEdl1E=; h=Date:To:Cc:Subject:From:In-Reply-To:References:From; b=oRb0/uFSeChxy2JNyYT44PdRxEZqKisCQ5ikeq6SKzld+oRZQCc9qNdhBTE6egh8i R7c45bTlxRtizpOjhfqzO2kk9Zv7G/WCrDGZ5ApyvZGwg/ILGeW3GYThM4VjkGIIVv khnpwQCG/eShhZ9c6gg4JGCiC2aYcSgG/Yv/Rbzk= Date: Wed, 19 Mar 2025 11:56:17 +0900 (JST) Message-Id: <20250319.115617.1633674031127518041.kou@clear-code.com> To: sawada.mshk@gmail.com Cc: tgl@sss.pgh.pa.us, zhjwpku@gmail.com, michael@paquier.xyz, pgsql-hackers@postgresql.org Subject: Re: Make COPY format extendable: Extract COPY TO format implementations From: Sutou Kouhei In-Reply-To: References: <20250305.090608.575196107267477043.kou@clear-code.com> X-Mailer: Mew version 6.8 on Emacs 30.1 Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="--Next_Part(Wed_Mar_19_11_56_17_2025_532)--" Content-Transfer-Encoding: 7bit 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)[multipart/mixed,text/plain,text/x-patch]; FUZZY_RATELIMITED(0.00)[rspamd.com]; ARC_NA(0.00)[]; ASN(0.00)[asn:2518, ipnet:2404:7a80::/29, country:JP]; TAGGED_RCPT(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:+,3:+,4:+,5:+,6:+,7:+,8:+,9:+,10:+]; RCVD_COUNT_ZERO(0.00)[0]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; FREEMAIL_CC(0.00)[sss.pgh.pa.us,gmail.com,paquier.xyz,postgresql.org]; FROM_HAS_DN(0.00)[]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; RCPT_COUNT_FIVE(0.00)[5] X-Rspamd-Server: mail.clear-code.com X-Rspamd-Action: no action X-Rspamd-Queue-Id: 31F9F68925D List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk ----Next_Part(Wed_Mar_19_11_56_17_2025_532)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi, In "Re: Make COPY format extendable: Extract COPY TO format implementations" on Mon, 17 Mar 2025 13:50:03 -0700, Masahiko Sawada wrote: > I think that built-in formats also need to have their handler > functions. This seems to be a conventional way for customizable > features such as tablesample and access methods, and we can simplify > this function. OK. 0008 in the attached v37 patch set does it. > I think we need to update the documentation to describe how users can > define the handler functions and what each callback function is > responsible for. I agree with it but we haven't finalized public APIs yet. Can we defer it after we finalize public APIs? (Proposed public APIs exist in 0003, 0006 and 0007.) And could someone help (take over if possible) writing a document for this feature? I'm not good at writing a document in English... 0009 in the attached v37 patch set has a draft of it. It's based on existing documents in doc/src/sgml/ and *.h. 0001-0007 aren't changed from v36 patch set. Thanks, -- kou ----Next_Part(Wed_Mar_19_11_56_17_2025_532)-- Content-Type: Text/X-Patch; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="v37-0001-Add-support-for-adding-custom-COPY-TO-format.patch"