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 1kNXme-0007m9-HU for pgsql-hackers@arkaria.postgresql.org; Wed, 30 Sep 2020 08:48:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kNXmc-0001rY-5X for pgsql-hackers@arkaria.postgresql.org; Wed, 30 Sep 2020 08:48:18 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kNXmb-0001rQ-Q6 for pgsql-hackers@lists.postgresql.org; Wed, 30 Sep 2020 08:48:17 +0000 Received: from mail.postgrespro.ru ([93.174.131.139]) by magus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kNXmY-0003gV-OB for pgsql-hackers@postgresql.org; Wed, 30 Sep 2020 08:48:16 +0000 Received: from [172.20.10.4] (unknown [176.59.195.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mail.postgrespro.ru (Postfix) with ESMTPSA id 3AA7121C38FA; Wed, 30 Sep 2020 11:48:13 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1601455693; bh=KyzWuSpXysoKD/2oXywzwMN35kpiBtcZ0w3eCuTqjl0=; h=Subject:To:References:From:Date:In-Reply-To; b=l2yawH0rPkFJmPTZ+rbxeZKX4vIHOaihrJpEgaOWin2iw/9bm6R8NqJP7MWakzxDw 3ZgqPFAfZe9wbnAkBlaywWoNR0gp1pQ50PAhLaeYYz4lR1xQ2P0kmtG+S18AL3Xh29 hcMYkl7w1MdOynYJwYGLNNbEOWzYvYWtIZFCiEjI= Subject: Re: Adding Support for Copy callback functionality on COPY TO api To: "Sanaba, Bilva" , "pgsql-hackers@postgresql.org" References: <253C21D1-FCEB-41D9-A2AF-E6517015B7D7@amazon.com> From: "Andrey V. Lepikhov" Organization: Postgres Professional Message-ID: Date: Wed, 30 Sep 2020 13:48:12 +0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <253C21D1-FCEB-41D9-A2AF-E6517015B7D7@amazon.com> 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: Precedence: bulk On 7/2/20 2:41 AM, Sanaba, Bilva wrote: > Hi hackers, > > Currently, the COPY TO api does not support callback functions, while > the COPY FROM api does. The COPY TO code does, however, include > placeholders for supporting callbacks in the future. > > Rounding out the support of callback functions to both could be very > beneficial for extension development. In particular, supporting > callbacks for COPY TO will allow developers to utilize the preexisting > command in order to create tools that give users more support for moving > data for storage, backup, analytics, etc. > > We are aiming to get the support in core PostgreSQL and add COPY TO > callback support in the next commitfest.The attached patch contains a > change to COPY TO api to support callbacks. > Your code almost exactly the same as proposed in [1] as part of 'Fast COPY FROM' command. But it seems there are differences. [1] https://www.postgresql.org/message-id/flat/3d0909dc-3691-a576-208a-90986e55489f%40postgrespro.ru -- regards, Andrey Lepikhov Postgres Professional