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 1szvGz-008hyC-HK for pgsql-hackers@arkaria.postgresql.org; Sun, 13 Oct 2024 09:52:25 +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 1szvGx-001O7W-B5 for pgsql-hackers@arkaria.postgresql.org; Sun, 13 Oct 2024 09:52:23 +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 1szvGw-001O7N-VW for pgsql-hackers@lists.postgresql.org; Sun, 13 Oct 2024 09:52:23 +0000 Received: from meldrar.postgresql.org ([2a02:c0:301:0:ffff::31]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1szvGp-000ogb-Px for pgsql-hackers@lists.postgresql.org; Sun, 13 Oct 2024 09:52:22 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=postgresql.org; s=20171124; h=Content-Transfer-Encoding:Content-Type: Mime-Version:References:In-Reply-To:From:Subject:Cc:To:Message-Id:Date:Sender :Reply-To:Content-ID:Content-Description; bh=mAa79jsaHtJ756fmVvoJIx7/ye2H6Yz49w8Kt1g7qLc=; b=la8R0Szpq4+moVB1zv62qc4maH 90VS6GJf2IzUSJ2JW++5m8BfCMErhC5hnw4BFxeQkPCOjq5GrM3EQbpGLYNOrjunhqTGAMUyUq7TO XI4JIe7g32yksdTOAdIjVWwqdJyPIZdv4+oHTwoxWay6SKeQo+74i5XxtmYGpSrI+vHHIDeF1nbcm 9t5S0aEYQvjOvio76MJPd/KBlwPp9zhznHNpI7/piLBEPfuDb1cRUpEVZpMr/n/546D4dxXGuOKbf /ww8ivV3uN45BgtA4Kt8rHEeJ/dhWarTgabbieBK4XzqOzrm/VP3OtmAp85hTsTdfUyzB5rOl1G31 RqaNjfqA==; Received: from [2409:11:4120:300:764b:e15a:3a17:b58d] (helo=localhost) by meldrar.postgresql.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 (Exim 4.94.2) (envelope-from ) id 1szvGn-005xGn-Bj; Sun, 13 Oct 2024 09:52:16 +0000 Date: Sun, 13 Oct 2024 18:52:04 +0900 (JST) Message-Id: <20241013.185204.1992992241505690866.ishii@postgresql.org> To: joel@compiler.org Cc: pgsql-hackers@lists.postgresql.org Subject: Re: New "raw" COPY format From: Tatsuo Ishii In-Reply-To: References: X-Mailer: Mew version 6.8 on Emacs 26.3 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 2409:11:4120:300:764b:e15a:3a17:b58d (failed) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > Hi hackers, > > This thread is about implementing a new "raw" COPY format. > > This idea came up in a different thread [1], moved here. > > [1] https://postgr.es/m/47b5c6a7-5c0e-40aa-8ea2-c7b95ccf296f%40app.fastmail.com > > The main use-case for the raw format, is when needing to import arbitrary > unstructured text files, such as log files, into a single text column > of a table. After copy imported the "unstructured text file" in "row" COPY format, what the column type is? text? or bytea? If it's text, how do you handle encoding conversion if the "unstructured text file" is encoded in server side unsafe encoding such as SJIS? > All characters are taken literally. > There is no special handling for quotes, backslashes, or escape sequences. If SJIS text is imported "literally" (i.e. no encoding conversion), it should be rejected. Best reagards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp