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 1r2qTS-0014Q0-04 for pgsql-hackers@arkaria.postgresql.org; Tue, 14 Nov 2023 10:16:50 +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 1r2qTQ-006WP2-A9 for pgsql-hackers@arkaria.postgresql.org; Tue, 14 Nov 2023 10:16:48 +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 1r2qTP-006WOt-Ta for pgsql-hackers@lists.postgresql.org; Tue, 14 Nov 2023 10:16:48 +0000 Received: from forward500b.mail.yandex.net ([178.154.239.144]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r2qTL-005W5S-B8 for pgsql-hackers@postgresql.org; Tue, 14 Nov 2023 10:16:46 +0000 Received: from mail-nwsmtp-smtp-production-main-22.iva.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-22.iva.yp-c.yandex.net [IPv6:2a02:6b8:c0c:3995:0:640:f3e3:0]) by forward500b.mail.yandex.net (Yandex) with ESMTP id 17E30611ED; Tue, 14 Nov 2023 13:16:39 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-22.iva.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id ZGgmn03UvW20-nbJoQ1H0; Tue, 14 Nov 2023 13:16:38 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1699956998; bh=MUSyKck7xjab2z8u9F+GpMhG+IVz4zbiJP171J28lFM=; h=In-Reply-To:Cc:Date:References:To:Subject:Message-ID:From; b=hPOY3h4MaaRibKPMfW4ZwoKxNkZ16BFkW6yjF91KpGlj5Vunf1SJ0hRW43tB7lHrY FhcZphgKdoJGJLK69Wf2juzF0PCT4Zs3BEjqt+jKBU8WFFnFfHi6zkgVXsM3SAoOhy z/lNPCDF/H02QrQ29+qC98+/YdhN9iaVYwCBs+6U= Authentication-Results: mail-nwsmtp-smtp-production-main-22.iva.yp-c.yandex.net; dkim=pass header.i=@yandex.ru Content-Type: multipart/alternative; boundary="------------fD9OltZetOFm0FcTMOJ0z6CA" Message-ID: <2c18cf9c-b895-4d98-a700-fbf12463a984@yandex.ru> Date: Tue, 14 Nov 2023 13:16:35 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: POC PATCH: copy from ... exceptions to: (was Re: VLDB Features) To: Damir Belyalov , zhihuifan1213@163.com Cc: Tom Lane , Daniel Gustafsson , torikoshia , PostgreSQL Hackers , Andres Freund , anisimow.d@gmail.com, HukuToc@gmail.com, Andrey Lepikhov , pgsql-hackers@lists.postgresql.org References: <483E1B59-4A80-450B-8685-7CC12762FD5A@anarazel.de> <9a94e684d6528dff74de5959e97032f3@oss.nttdata.com> <8e5c596e47435e3b37b7a751ebcd9569@oss.nttdata.com> <20230322175000.qbdctk7bnmifh5an@awork3.anarazel.de> <16e09747fcfbb21c30e4c1009c416aa4@oss.nttdata.com> <19551e8c2717c24689913083f841ddb5@oss.nttdata.com> <43399b33fe573f0548410893f41f84b6@oss.nttdata.com> <8de9d5e1-2f81-ee2e-ece4-b1a6ede1f285@yandex.ru> <58fa3b63e88ffd0a09273e38aec0661e@oss.nttdat!> <752672.1699474336@sss.pgh.pa.us> <878r77mtlt.fsf@163.com> Content-Language: en-US From: Alena Rybakina In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------fD9OltZetOFm0FcTMOJ0z6CA Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi! On 14.11.2023 13:10, Damir Belyalov wrote: > >  Here is a very straw-man-level sketch of what I think might work. >  The option to COPY FROM looks something like > >       ERRORS TO other_table_name (item [, item [, ...]]) > > > I tried to implement the patch using a table and came across a number > of questions. > > Which table should we implement for this feature: a system catalog > table or store this table as a file or create a new table? > > In these cases, security and user rights management issues arise. > It is better for other users not to see error lines from another user. > It is also not clear how access rights to this table are inherited and > be given. > > Maybe we can add a guc or a parameter to output such errors during the execution of the copy function with errors and check whether the user has enough rights to set such a parameter? That is, I propose to give the user a choice to run copy with and without saving errors and at the same time immediately check whether the option with error output is possible for him in principle? -- Regards, Alena Rybakina --------------fD9OltZetOFm0FcTMOJ0z6CA Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

Hi!

On 14.11.2023 13:10, Damir Belyalov wrote:
 Here is a very straw-man-level sketch of what I think might work.
 The option to COPY FROM looks something like

      ERRORS TO other_table_name (item [, item [, ...]])

I tried to implement the patch using a table and came across a number of questions.

Which table should we implement for this feature: a system catalog table or store this table as a file or create a new table?

In these cases, security and user rights management issues arise.
It is better for other users not to see error lines from another user. It is also not clear how access rights to this table are inherited and be given.


Maybe we can add a guc or a parameter to output such errors during the execution of the copy function with errors and check whether the user has enough rights to set such a parameter?

That is, I propose to give the user a choice to run copy with and without saving errors and at the same time immediately check whether the option with error output is possible for him in principle?

-- 
Regards,
Alena Rybakina
--------------fD9OltZetOFm0FcTMOJ0z6CA--