RE: Back Slash \ issue

From: Guntry Vinod <GV00619735(at)TechMahindra(dot)com>
To: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, "ravikrishna(at)mail(dot)com" <ravikrishna(at)mail(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Cc: Venkatamurali Krishna Gottuparthi <VG00114307(at)TechMahindra(dot)com>, "Biswa Ranjan Dash" <BD00617837(at)TechMahindra(dot)com>
Subject: RE: Back Slash \ issue
Date: 2019-05-03 05:48:46
Message-ID: f402601ecb4443ab85ef5f7fc0d4aade@HYDEXCHMBX003.TechMahindra.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi Team,

We are using the below command

COPY <<TableName>> from 'C:\Data_Dump\ABC.txt' DELIMITER '|';

Regards,
Vinod

-----Original Message-----
From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Sent: Thursday, May 2, 2019 8:58 PM
To: Guntry Vinod <GV00619735(at)TechMahindra(dot)com>; ravikrishna(at)mail(dot)com
Cc: pgsql-general(at)postgresql(dot)org; Venkatamurali Krishna Gottuparthi <VG00114307(at)TechMahindra(dot)com>; Biswa Ranjan Dash <BD00617837(at)TechMahindra(dot)com>
Subject: Re: Back Slash \ issue

On 5/2/19 8: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.
>
> Since the dump is huge data I can't replace \ within the data to escape Slash.
>
> We are using import utility provided by Postgre.

Are you talking about COPY or some other utility?

>
> Can you please give me any solution in this regard?.

In order for a solution to be found we will need more explicit information on what you are doing.

>
> @kiran-let me also try solution you provided in the below mail.
>
> Regards,
> Vinod
> _______________________________________
> From: Adrian Klaver [adrian(dot)klaver(at)aklaver(dot)com]
> Sent: 02 May 2019 20:04
> To: ravikrishna(at)mail(dot)com; Guntry Vinod
> Cc: pgsql-general(at)postgresql(dot)org; Venkatamurali Krishna Gottuparthi;
> Biswa Ranjan Dash
> Subject: Re: Back Slash \ issue
>
> On 5/2/19 7:30 AM, ravikrishna(at)mail(dot)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(dot)klaver(at)aklaver(dot)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 <http://www.techmahindra.com/Disclaimer.html> externally http://tim.techmahindra.com/tim/disclaimer.html <http://tim.techmahindra.com/tim/disclaimer.html> internally within TechMahindra.
>
> ======================================================================
> ======================================================
>
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Laurenz Albe 2019-05-03 06:19:21 Re: Migrating an application with Oracle temporary tables
Previous Message Ray Cote 2019-05-02 20:20:24 Re: Debugging Failed Startup