Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hMalm-0008HO-Ca for pgsql-general@arkaria.postgresql.org; Fri, 03 May 2019 16:10:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hMall-0000qw-3l for pgsql-general@arkaria.postgresql.org; Fri, 03 May 2019 16:10:41 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hMakj-0004AZ-6H for pgsql-general@lists.postgresql.org; Fri, 03 May 2019 16:09:38 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hMakf-0007Ki-5z for pgsql-general@postgresql.org; Fri, 03 May 2019 16:09:36 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 8A05A2490E; Fri, 3 May 2019 12:09:31 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Fri, 03 May 2019 12:09:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm2; bh=H ev1iq9+qc08h+3bsu24teN0T+poL9vbKssIzhKv+BY=; b=WIe3NSGAbM46/Fmzm qmFy5LCHVJSWR2BQD3I/psALeDdbtkKNayGlRa16fuY4h49zbn37yW08/itaaH/6 KHtyBGTa3qR5Xke4GJeFgivoWNksQgyRcztTI303HWXR/B6ie4tXBLBh1Y245vJu d0v09WtgpChunfkLQ7nlmoTUsyW4kmfl9UOLqkMrPnzOJgiRz46LRb5bnFsnnvlE EZmgDUhPyv0x4XE6JYgpHK/yZ3d/Ct2qXYroKcrAiVxrhQgoVPYQ1XWsSuffSKrz w0oZTVZIm9xJQd2s2YQTptL083bU9NjKqXB9+UdHu890HZgulkTnvoG2ffSkuIqO Cweuw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=Hev1iq9+qc08h+3bsu24teN0T+poL9vbKssIzhKv+ BY=; b=sLUAYrAC/yAo60f39BXLeGAdinNVuwKy2eIyjyGBC/scgpFKD5zA8mrwu 8/3N9iPJnkm6pKqeoj1uQhf9xjeQyxCAJXo5CSJq7fq8X3rmS2Jx54OeT2Devt9W 6Jdv8UDfsvNz56j2BDcRQPP8lZwwBIN7Qf1H//vCJknG3JrjtLHMsqUTd7wtybFz fqKKzYSqckY7HmByd4gj0uBldNuOyaTxW0es8Y8rNhrI0oRhSJtT6JMW8hnqO7cn /kXZ9QZeACkqlGBYz+EwtybDB6rXvn430UOj8hDgyfM2v4wo+1z2p2cZ/Llg/7ol NKKJ/hvp3Z+p4v2nFPmjNDpJx1nWA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddrjedugddutdduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepuffvfhfhkffffgggjggtgfesthejredttdefjeenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucffohhmrghinhepthgvtghhmhgrhhhinhgurhgrrdgtohhmnecukfhppeehtddr udeljedrkedtrddvnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrughrihgrnhdrkhhlrg hvvghrsegrkhhlrghvvghrrdgtohhmnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from ranger.suse (50-197-80-2-static.hfc.comcastbusiness.net [50.197.80.2]) by mail.messagingengine.com (Postfix) with ESMTPA id 88373E4649; Fri, 3 May 2019 12:09:29 -0400 (EDT) Subject: Re: Back Slash \ issue To: Guntry Vinod , Ravi Krishna , Michael Nolan Cc: "pgsql-general@postgresql.org" , Venkatamurali Krishna Gottuparthi , Biswa Ranjan Dash References: <3f17d700-5cfb-637a-dc70-112b69e53b01@aklaver.com> <797cd76f5520436f87e68ebe980972d3@HYDEXCHMBX003.TechMahindra.com> <1989ca98-23e4-21c2-addd-1710ad78cbf7@aklaver.com> <336AC136-C15B-4B46-899F-9674CA15500A@mail.com> <346D2F54-D13D-4C45-9E42-1E51F36ED85F@mail.com> <3c30cf5a10594124afb151a29e335ca2@HYDEXCHMBX003.TechMahindra.com> From: Adrian Klaver Message-ID: <7af20b60-b406-c2e9-470a-76fc5c8296b9@aklaver.com> Date: Fri, 3 May 2019 09:09:28 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <3c30cf5a10594124afb151a29e335ca2@HYDEXCHMBX003.TechMahindra.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 5/3/19 9:05 AM, Guntry Vinod wrote: > Hi Team, > > Here we go. I will give the problem in more detail > > Step 1:We get the dump from DB2 and this dump is flat file which can be csv,txt The above is what we need information on: 1) Is it output as CSV or text? 2) What are the parameters used to output the data in either case?. In other words, is string quoting used, the field delimiter, etc. > Step2:There is table in PostGre where we are suppose to upload the dump > Step3:We are using copy command to upload dump to the table using (COPY <> from 'C:\Data_Dump\ABC.txt' DELIMITER '|'; ) > Step 4:In the above step we are using delimiter because the data is separated (:) in the flat which we have received from the flat file > > Problem Statement:We are able to upload the data from the flat file which we got from the DB2 but few data the data consist of " \".For example if the CustomerName is Vinod\G in the flat file ,we expect the same data in PostGre table for CustomerName as Vinod\G but we see VinodG(slash is missed). > > Possible Solution: We can replace "\" with "\\" but if the file is in too large we cannot open it(we can replace if the file is medium or small) > > Expectation: We need a command or utility which can upload the data as it is (for example if Vinod\G then we should see in PostGre as Vinod\G but not VinodG) > > Hope Iam detail this time :-) > > Regards, > Vinod > > > > > -----Original Message----- > From: Ravi Krishna > Sent: Friday, May 3, 2019 8:43 PM > To: Michael Nolan > Cc: Adrian Klaver ; Guntry Vinod ; pgsql-general@postgresql.org; Venkatamurali Krishna Gottuparthi ; Biswa Ranjan Dash > Subject: Re: Back Slash \ issue > >> >> I don't think we've seen enough representative data to know exactly what the backslash is doing. It doesn't appear to be an escape, based on the sole example I've seen it appears to be a data separator between first name and last name. >> >> It seems increasingly likely to me that you might not be in a position where the COPY command in PostgreSQL can handle loading the database, at least not without some help. You might have to write a program to clean up the data and format it for PostgreSQL. >> >> I've spent a lot of time over the years migrating data from one platform to another, you have to know EXACTLY what data you currently have and what format you need it turned into before you can figure out how to do the transformation. >> -- >> Mike Nolan > > Fully agreed. I have informed Guntry via email that he has to provide more information before we can help further. > ============================================================================================================================ > > Disclaimer: This message and the information contained herein is proprietary and confidential and subject to the Tech Mahindra policy statement, you may review the policy at http://www.techmahindra.com/Disclaimer.html externally http://tim.techmahindra.com/tim/disclaimer.html internally within TechMahindra. > > ============================================================================================================================ > -- Adrian Klaver adrian.klaver@aklaver.com