pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Gierth <andrew@tao11.riddles.org.uk>
To: Guntry Vinod <GV00619735@TechMahindra.com>
Cc: Adrian Klaver <adrian.klaver@aklaver.com>
Cc: ravikrishna\@mail.com <ravikrishna@mail.com>
Cc: pgsql-general\@postgresql.org <pgsql-general@postgresql.org>
Cc: Venkatamurali Krishna Gottuparthi <VG00114307@TechMahindra.com>
Cc: Biswa Ranjan Dash <BD00617837@TechMahindra.com>
Subject: Re: Back Slash \ issue
Date: Fri, 03 May 2019 09:07:03 +0100
Message-ID: <87h8achsx2.fsf@news-spur.riddles.org.uk> (raw)
In-Reply-To: <f402601ecb4443ab85ef5f7fc0d4aade@HYDEXCHMBX003.TechMahindra.com>
References: <ad7149ce9d594ed396bebad4194e57d6@HYDEXCHMBX003.TechMahindra.com>
	<trinity-2a68e86c-51d7-41a2-8008-1a21c0850f0e-1556807412712@3c-app-mailcom-lxa07>
	<3f17d700-5cfb-637a-dc70-112b69e53b01@aklaver.com>
	<797cd76f5520436f87e68ebe980972d3@HYDEXCHMBX003.TechMahindra.com>
	<1989ca98-23e4-21c2-addd-1710ad78cbf7@aklaver.com>
	<f402601ecb4443ab85ef5f7fc0d4aade@HYDEXCHMBX003.TechMahindra.com>

>>>>> "Guntry" == Guntry Vinod <GV00619735@TechMahindra.com> writes:

 Guntry> Hi Team,
 Guntry> We are using the below command

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

COPY in postgresql expects one of two data formats; since you did not
specify CSV, in this case it's expecting the default postgresql format
which requires the use of \ for escapes like \r, \n, \t, \\, \012 and
for the default NULL specification of \N.

If you use this format it is therefore your responsibility to ensure
that any literal \ characters in the data are escaped as \\, and that
any literal appearance of the delimiter character or a newline is also
escaped.

See https://www.postgresql.org/docs/current/sql-copy.html under "Text
format".

-- 
Andrew (irc:RhodiumToad)





view thread (31+ messages)  latest in thread

Message-ID: <87h8achsx2.fsf@news-spur.riddles.org.uk>
Permalink:  ../87h8achsx2.fsf@news-spur.riddles.org.uk/
Also on:    postgresql.org/message-id/87h8achsx2.fsf@news-spur.riddles.org.uk

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: andrew@tao11.riddles.org.uk, GV00619735@TechMahindra.com, adrian.klaver@aklaver.com, ravikrishna@mail.com, VG00114307@TechMahindra.com, BD00617837@TechMahindra.com
  Subject: Re: Back Slash \ issue
  In-Reply-To: <87h8achsx2.fsf@news-spur.riddles.org.uk>
  References: <ad7149ce9d594ed396bebad4194e57d6@HYDEXCHMBX003.TechMahindra.com> <trinity-2a68e86c-51d7-41a2-8008-1a21c0850f0e-1556807412712@3c-app-mailcom-lxa07> <3f17d700-5cfb-637a-dc70-112b69e53b01@aklaver.com> <797cd76f5520436f87e68ebe980972d3@HYDEXCHMBX003.TechMahindra.com> <1989ca98-23e4-21c2-addd-1710ad78cbf7@aklaver.com> <f402601ecb4443ab85ef5f7fc0d4aade@HYDEXCHMBX003.TechMahindra.com> <87h8achsx2.fsf@news-spur.riddles.org.uk>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox