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 1r6NF9-000gIQ-AY for pgsql-hackers@arkaria.postgresql.org; Fri, 24 Nov 2023 03:52:39 +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 1r6NF5-007LaS-Ub for pgsql-hackers@arkaria.postgresql.org; Fri, 24 Nov 2023 03:52:35 +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 1r6NF5-007LaJ-LO for pgsql-hackers@lists.postgresql.org; Fri, 24 Nov 2023 03:52:35 +0000 Received: from mail.postgrespro.ru ([93.174.131.139]) by magus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r6NF2-008DCp-I8 for pgsql-hackers@lists.postgresql.org; Fri, 24 Nov 2023 03:52:34 +0000 Received: from [10.10.20.88] (node-6s3.pool-101-109.dynamic.totinternet.net [101.109.34.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: a.lepikhov@postgrespro.ru) by mail.postgrespro.ru (Postfix/587) with ESMTPSA id 63CD3E21040; Fri, 24 Nov 2023 06:52:28 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mx2023; t=1700797951; bh=jzr0vyMCuAs4plCu4uDeyvOryZDGbnXKlSa773rx1mQ=; h=Message-ID:Date:User-Agent:Subject:To:Cc:References:From: In-Reply-To:From; b=wggsPrAa9nREAnZ5myTV8HrRdcy/hAoPhCgEkU2NOE0XZ+7TrhSA8gDmYCCI+8n7J G+kMaGXpwuEmFwU4J6WStNm9vR5VYC0e9mj2anx4VgxCSD9+YIglUD8cTAWaiEcJMr ifOTNC+SrYR6dkOUdtl+DEtFGXmB8ZwUn7TkcH2ZHFQ52N1UtDmLOonmDjFxMKXrIw s/pOsHyh78PgGkf4wPpV7R7kPHrTOzAkQuklZGZHheIJRMuS3iyr/79Xr/GzGAEXr3 yRosSWoOYI1Th5QLS5swOHjwawhGmv3a9HQXll2TY+fykHvMHVUAT2ZFai4JuYkoyo PhPj4LcALWJgQ== Message-ID: <760ee97a-e336-4d7b-9477-9d9e99370097@postgrespro.ru> Date: Fri, 24 Nov 2023 10:52:25 +0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: POC PATCH: copy from ... exceptions to: (was Re: VLDB Features) Content-Language: en-US To: Damir Belyalov , zhihuifan1213@163.com Cc: Tom Lane , Daniel Gustafsson , torikoshia , PostgreSQL Hackers , Andres Freund , anisimow.d@gmail.com, HukuToc@gmail.com, Alena Rybakina , 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> From: Andrei Lepikhov Organization: Postgres Professional In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 14/11/2023 17: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. Previous reviews have given helpful ideas about storing errors in the new table. It should be trivial code - use the current table name + 'err' + suffix as we already do in the case of conflicting auto-generated index names. The 'errors table' must inherit any right policies from the table, to which we do the copy. -- regards, Andrei Lepikhov Postgres Professional