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 1hMEyI-0005rZ-U4 for pgsql-general@arkaria.postgresql.org; Thu, 02 May 2019 16:54:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hMEyG-0007J8-Ve for pgsql-general@arkaria.postgresql.org; Thu, 02 May 2019 16:54:08 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hMEyG-0007Iw-Gj for pgsql-general@lists.postgresql.org; Thu, 02 May 2019 16:54:08 +0000 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hMEyC-0000mS-Im for pgsql-general@lists.postgresql.org; Thu, 02 May 2019 16:54:07 +0000 Received: by mail-pl1-x641.google.com with SMTP id ck18so1306484plb.1 for ; Thu, 02 May 2019 09:54:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=O5Dys4blXW8HeTz0+dr4f0A87KzsR4iJFNwuadjlM4c=; b=fneHlwI/JD7ACUuKK9YoNpvr2GW3d21WF7YaJj0Y1gsLcXrnwhJYsrhoZyDt/k607B jJovG/N473ujxi7tHHuM5uIq/NeflZ9cbbj2z4QQnytnTSibtN+MMcWXQj8PoFSNQjGD ICG5RQeGtxTF6zN8AYUUbohabWGWKZBNyeutvICB+mfhlg9+zd1Vz6lNEkwz5QHSy3Fo cVs+wRJLpcgQnqBtwDB58UuFtAYWyETbOxAT6mgt72m1hreXk+T/MmQ2xe9OcoQRlRKN DjF1qbK9q0lpiJWn1cPcTPhsl6DrvKwl4faeoDF5cFbcdqYWH4vfkye+76jp0x0sZhlz 8FUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=O5Dys4blXW8HeTz0+dr4f0A87KzsR4iJFNwuadjlM4c=; b=lm9Yq2ozT2f6q98O5IWKQlUWReGn4g+5LYfAYoIvSrZwLlp2QUzj+jBMrYcIa2jvbW yyXx5yIykbekVIhw+12sFqhnL7ay/1RMsS0aDnQxZLyUejA1pQTsSGbhGJIlAdSM4O1t 0x4oCRyHJvEZarYk6qR27Bfoqn+e1DeVK1CSW0awMHWABhnD1KF2xSj6yypHWi6FGKG1 v2nucGSghURebLjsl7IktLV0NFhXnkCtq+nWfU+CBRwXmDSMKAr+Boap1RXvsKiKf5tv Mn6vSMeJY9pXevTMKVsWeo35vTsxfSOpTh/JQ+47YtXOnPR3TrvarJbjI1Y4T7C3fZj6 y21w== X-Gm-Message-State: APjAAAV2jYQbZz+sOheniWHxfl8UlhU1eBf5KIHTdiEhyJX/3QktPXj3 pA+Zz2tqKaKe2OrJj4PWmW1l129p X-Google-Smtp-Source: APXvYqwlWQzUjOfitESK6EEbZtNWWDKsI50CLu0Aq3qF3egMgkagmtRjFBhIhPQ4iYT24vbnND4ksg== X-Received: by 2002:a17:902:2a28:: with SMTP id i37mr4169135plb.47.1556816043225; Thu, 02 May 2019 09:54:03 -0700 (PDT) Received: from [10.104.134.41] ([155.100.47.1]) by smtp.gmail.com with ESMTPSA id e186sm17213080pfa.150.2019.05.02.09.54.02 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 May 2019 09:54:02 -0700 (PDT) Subject: Re: Back Slash \ issue To: pgsql-general@lists.postgresql.org References: <3f17d700-5cfb-637a-dc70-112b69e53b01@aklaver.com> <797cd76f5520436f87e68ebe980972d3@HYDEXCHMBX003.TechMahindra.com> From: Rob Sargent Message-ID: <29c3b664-c575-e578-9054-330854d041de@gmail.com> Date: Thu, 2 May 2019 10:54:01 -0600 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: <797cd76f5520436f87e68ebe980972d3@HYDEXCHMBX003.TechMahindra.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 5/2/19 9:19 AM, Guntry Vinod wrote: > Hi Adrian\Kiran, > > Below is the issue. > > We are migrating from Db2 to Postgre. > > The Db2 dump consists of back Slash \ with in the data [dump] , but postgre is not escaping the Slash. > > For example if name consist of Vinod\G after the inserting the dump the value in postgre is VinodG where as I need it as Vinod\G. Have you tried somlething like     sed 's/\\/\\\\/g' db2dump > db2dump.fixed > > Since the dump is huge data I can't replace \ within the data to escape Slash. > > We are using import utility provided by Postgre. > > Can you please give me any solution in this regard?. > > @kiran-let me also try solution you provided in the below mail. > > Regards, > Vinod > _______________________________________ > From: Adrian Klaver [adrian.klaver@aklaver.com] > Sent: 02 May 2019 20:04 > To: ravikrishna@mail.com; Guntry Vinod > Cc: pgsql-general@postgresql.org; Venkatamurali Krishna Gottuparthi; Biswa Ranjan Dash > Subject: Re: Back Slash \ issue > > On 5/2/19 7:30 AM, ravikrishna@mail.com wrote: >> > We have dump from DB2 and trying to upload it Postgre. >> DB2 export command has an option to export it as CSV which quotes data >> so that any embedded >> lines or special characters inside the data is treated fine. Does the >> csv format has quotes enclosing it ? > Please show the command you use to import into Postgres. > Also the error message you get. > > > -- > Adrian Klaver > adrian.klaver@aklaver.com > ============================================================================================================================ > > 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. > > ============================================================================================================================ > > >