小编Ale*_*elo的帖子

将文本内容导出到文本文件,不带\n标记

当我尝试导出字段的文本内容,并且该内容具有回车符时,该字符的输出类似于 \N 字符串。

例如:

create table foo ( txt text );
insert into foo ( txt ) values ( 'first line
second line
...
and other lines');
copy foo ( txt ) to '/tmp/foo.txt';
Run Code Online (Sandbox Code Playgroud)

我想返回以下(a):

first line
second line
...
and other lines
Run Code Online (Sandbox Code Playgroud)

但是,输出是 (b):

first line\Nsecond line\N...\Nand other lines
Run Code Online (Sandbox Code Playgroud)

有人知道如何获得(a)输出吗?

postgresql

3
推荐指数
1
解决办法
1507
查看次数

标签 统计

postgresql ×1