我是 postgresql 的新手,刚开始使用它。我正在尝试将文件加载到表中并面临一些问题。
示例数据 - 文件 file1.RPT 包含以下格式的数据
"Bharath"|Kumar|Krishnan
abc"|def|ghi
qwerty|asdfgh|lkjhg
下面是使用的加载脚本
LOAD CSV
INTO table1
....
WITH truncate,
fields optionally enclosed by '"',
fields escaped by '"'
fields terminated by '|'
....
但是,上面的脚本不起作用,并且没有将任何数据加载到表中。我不确定这里有什么问题。我的理解是必须成功加载第一行数据(因为我已经给出了可选的括起来)并且第二行也必须加载(因为我试图逃避双引号)。
请求帮助以得到相同的纠正。
谢谢你。