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 1hMTE0-0002p9-L2 for pgsql-general@arkaria.postgresql.org; Fri, 03 May 2019 08:07:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hMTDy-00079j-Hx for pgsql-general@arkaria.postgresql.org; Fri, 03 May 2019 08:07:18 +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 1hMTDy-00079c-8M for pgsql-general@lists.postgresql.org; Fri, 03 May 2019 08:07:18 +0000 Received: from lungold.riddles.org.uk ([82.68.208.19]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hMTDs-00055g-B3 for pgsql-general@postgresql.org; Fri, 03 May 2019 08:07:17 +0000 Received: from [192.168.127.1] (port=15894 helo=caithnard.riddles.org.uk) by lungold.riddles.org.uk with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.88 (FreeBSD)) (envelope-from ) id 1hMTDl-0001nF-3v; Fri, 03 May 2019 08:07:05 +0000 Received: from [127.0.0.1] (port=16375 helo=caithnard.riddles.org.uk) by caithnard.riddles.org.uk with esmtp (Exim 4.89 (FreeBSD)) (envelope-from ) id 1hMTDk-0000yT-9r; Fri, 03 May 2019 08:07:04 +0000 From: Andrew Gierth To: Guntry Vinod Cc: Adrian Klaver , "ravikrishna\@mail.com" , "pgsql-general\@postgresql.org" , Venkatamurali Krishna Gottuparthi , "Biswa Ranjan Dash" Subject: Re: Back Slash \ issue In-Reply-To: (Guntry Vinod's message of "Fri, 3 May 2019 05:48:46 +0000") Message-ID: <87h8achsx2.fsf@news-spur.riddles.org.uk> References: <3f17d700-5cfb-637a-dc70-112b69e53b01@aklaver.com> <797cd76f5520436f87e68ebe980972d3@HYDEXCHMBX003.TechMahindra.com> <1989ca98-23e4-21c2-addd-1710ad78cbf7@aklaver.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (berkeley-unix) Date: Fri, 03 May 2019 09:07:03 +0100 MIME-Version: 1.0 Content-Type: text/plain List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk >>>>> "Guntry" == Guntry Vinod writes: Guntry> Hi Team, Guntry> We are using the below command Guntry> COPY <> 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)