Re: Use carriage return with copy in PostgreSQL - Mailing list pgsql-admin

From David G. Johnston
Subject Re: Use carriage return with copy in PostgreSQL
Date
Msg-id CAKFQuwaV=Y7dRyg7XgrYGPr+VTMsiYHUXw50+9Cs6f8E4Htg5g@mail.gmail.com
Whole thread Raw
In response to Use carriage return with copy in PostgreSQL  (Sergio Alonso <seralonso1014@gmail.com>)
List pgsql-admin
On Friday, May 14, 2021, Sergio Alonso <seralonso1014@gmail.com> wrote:
('TEST one\r\n' )
TEST one\\r\\n

This has nothing to do with the copy command.  You are mis-informed on how to write string literals, in particular expecting ‘\r’ to be escaped when in fact in a simple string literal the only special character is the single quote.

You need to review 4.1.1.2 (https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-CONSTANTS) if you need to write string literals that contain backslash escapes.

David J.

pgsql-admin by date:

Previous
From: Sergio Alonso
Date:
Subject: Use carriage return with copy in PostgreSQL
Next
From: Tim
Date:
Subject: pg_upgrade not excluding system tables in EPAS