【问题标题】:Copy text file as string将文本文件复制为字符串
【发布时间】:2021-10-20 14:11:37
【问题描述】:

如何在 PostgreSQL 中将文本文件复制为单列(基本上是复制没有列分隔符的文本文件)?

drop table if exists txt_file;
create temp table txt_file
(
string text
);

copy txt_file (string) from '(...)/functions.txt' csv;

【问题讨论】:

    标签: postgresql csv copy txt


    【解决方案1】:

    你不能,除非你能识别出两个从未在文件中指定为分隔符和引号的字符。否则,您将不得不对文件进行预处理以适当地转义。

    【讨论】:

      猜你喜欢
      • 2011-07-11
      • 2011-01-25
      • 2016-06-19
      • 2012-07-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-05-24
      相关资源
      最近更新 更多