简体   繁体   English

如何将我的 csv 文件导入 postgres?

[英]How can I import my csv file in to postgres?

1) I tried to import csv file by right clicking on 'column' name, then select import and my csv file, but when I query I cant see anything. 1)我尝试通过右键单击“列”名称来导入 csv 文件,然后选择导入和我的 csv 文件,但是当我查询时我什么也看不到。

2) Then I tried second way to import csv as in the pic by copying. 2)然后我尝试了第二种方法通过复制来导入图片中的csv。 it gives an error saying the table doesnt exist.它给出了一个错误,说该表不存在。

Okay I changed the database, but it still doesnt work好的,我更改了数据库,但它仍然无法正常工作

在此处输入图像描述

This worked well for me.这对我来说效果很好。 I hope it does for you too.我希望它也适合你。

COPY your_db_in_which_you_are_importing, FROM 'ABSOLUTE_PATH_OF_CSV_FILE/abc.csv' DELIMITER ',' CSV;

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我有带有变量类型的架构 CSV 文件,工作台无法理解,如何导入此 CSV 格式? - I have schema CSV file with variable types, workbench can't understand it, how to import this CSV format? 我想将数据从存储过程导入到csv文件中 - I want to import data from my stored procedure to a csv file 在 windows 上的 postgres 数据库中导入 a.sql 文件? - import a .sql file in my database on postgres on windows? 如何将csv文件导入到Google Cloud SQL服务(与导入SQL转储相反) - How can I import a csv file into the google cloud sql service (opposed to importing a sql dump) 为什么我不能将数据从 CSV 文件导入到表中? - Why can I not import data from CSV file to the table? 我可以使用相对路径将 csv 文件导入 mysql 吗? - Can I import csv file to mysql using relative path? 从csv文件加载到postgres数据库时,如何解决此错误“从字符串“ \\ N”到类型“ Double”的转换无效”? - how can i solve this error “Conversion from string ”\N“ to type 'Double' is not valid” when loading from a csv file to postgres database? 将 CSV 文件从 URL 导入 SQL Fiddle Postgres 9.6 引擎 - Import CSV file from URL into SQL Fiddle Postgres 9.6 engine SQL,postgres。 我有一个像avg这样的列的csv输入文件。 导出时如何保留数字? - SQL, postgres. I have a csv input file with columns like avg. When i export how do i keep my digits? 如何导入默认为一列的csv文件? - How do I import a csv file with one column defaulting?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM