How to escape \n (newline) when importing CSV into Postgres using \copy command?
<p>I am trying to import data into my postgres table using \copy from a CSV file
The data is as follows:</p>

<pre><code>1,2,"First Line \n Second Line", "Some other data"
</code></pre>

<p>My motive is to preserve '\n' while importing the data.</p>

<p>The following works:</p>

<pre><code>insert into table (col1, col2, col3, col4) values (1, 2, E'First Line \n Second Line', 'Some other data')
</code></pre>

<p>But how do I achieve the same result using \copy command? </p>