在windows下安装了pgAdmin,在e盘test文件夹下有一个之前导出的zxc.txt文件,现在想把该文件导入test表
我输入的命令是copy test from 'e:/test/zxc.txt' with delimiter ';'
可是总是报********** Error **********ERROR: could not open file "e:/test/zxc.txt" for reading: 这样的文件和路径不存在
SQL state: 58P01
这样的错误,不知道这种问题应该如何解决

解决方案 »

  1.   

    权限或者这样的文件根本就没有。我的测试。t_girl=# truncate test;
    TRUNCATE TABLE
    t_girl=# \d test
                资料表 "public.test"
       栏位   |         型别          |  修饰词
    ----------+-----------------------+----------
     id       | integer               | not null
     username | character varying(20) | not null
    索引:
        "test_pkey" PRIMARY KEY, btree (id)t_girl=# copy test from 'e:/p_test.txt';
    COPY 2
    t_girl=# select * from test;
     id | username
    ----+----------
      1 | love
      2 | hate
    (2 笔资料列)
      

  2.   

    p_test.txt内容:
    1 love
    2 hate