如何将excel表格数据导入postgresql数据库( 二 )


 8 | Donnie Yen | 36 | male | HK,CHINA,ASIA |
 9 | Stephen Chow | 40 | male | HK,CHINA,ASIA |
 
④查看上传至服务器内的excel表格数据
postgres=# \! cat /pg/movie_star.csv
user_id,user_name,age,gender,address,remark
1,Jackie Chan,45,male,”HK,CHINA,ASIA “,police story project A rush hour
2,Gong Li,38,female,” “”Singapore””,ASIA”, Farewell My Concubine Lifetimes Living
3,Brigitte Lin,46,female,” HK,CHINA,ASIA”,
4,Maggie Cheung,39,female,”HK,CHINA,ASIA “,
5,Jet Li,41,male,”””Singapore””,ASIA”, Fist of LegendOnce Upon a Time in China
6,Jacky Cheung ,35,male,”HK,CHINA,ASIA”,
7,Chow Yun Fat,48,male,”HK,CHINA,ASIA”,
8, Donnie Yen,36,male,”HK,CHINA,ASIA”,
9,Stephen Chow,40,male,”HK,CHINA,ASIA”,
通过在excel表格我们可以看到,将excel表格保存为csv格式(UTF-8,逗号分隔)后,系统自动对表格内的数据进行了格式转换,部分字段内加入了转义符,比如双引号,逗号等,避免了数据导入出错 。
文章来源:脚本之家
来源地址:https://www.jb51.net/article/206923.htm
【如何将excel表格数据导入postgresql数据库】申请创业报道,分享创业好点子 。,共同探讨创业新机遇!