eay*_*tan 6 csv postgresql pgadmin-4
目前,我使用的是 PostgreSQL 11.2 并且我有一个 ~4GB 的 .csv 文件。首先,我试图创建一个临时表并选择所需的列来填充我的当前表。
create temporary table t (identification varchar, a1 text, a2 text, a3 text, a4 text, a15 text, a6 text, a7 text, a8 text)
copy t
from 'C:\PostgreSqlData\mydata.csv'
delimiter ',' csv
Run Code Online (Sandbox Code Playgroud)
如果我得到一些较小的数据部分(~10MB),它不会给出任何错误。但是,当我尝试导入整个文件时,它给出:
无法统计文件“mydata.csv”:未知错误
首先检查psql是否已经安装。
打开你的终端
运行 psql 命令:
试试这个方法
psql -c "COPY tablename FROM 'C:\PostgreSqlData\mydata.csv' delimiter ',' csv;"
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5437 次 |
| 最近记录: |