以下是查询:
COPY public.project(project_number,project_name,country) from '\\server\csv\projects_export.csv' DELIMITERS ',' CSV;
此查询的结果是:
ERROR: could not open file "\\server\csv\projects_export.csv"
for reading: No such file or directory.
请指导我
答案 0 :(得分:0)
您需要在单引号字符串文字中转义/加倍反斜杠字符。这是文字Windows文件名的常见问题。 COPY
的文档特别警告:http://www.postgresql.org/docs/9.2/static/sql-copy.html
Dollar quoting是最简单的选择:
COPY public.project(project_number,project_name,country) from $$\\server\Softwel\Projects\projects\csv\projects_export.csv$$ DELIMITERS ',' CSV;