i haven't tried csv but i managed to make it work by following tom's adviceOn Sun, Jan 1, 2012 at 10:07 PM, Craig Barnes <cjbarnes18@gmail.com> wrote:Hi,On 1 January 2012 14:01, avalon78 geek <avalon78.gr@gmail.com> wrote: hi guys,i am new to pgsql and i am facing a strange problem which i cannot solve.i want to import data from a txt file to the table custthe table is CREATE TABLE cust( custid integer NOT NULL, custOccupation varchar(30) NOT NULL, PRIMARY KEY(custid)} and the txt file contains13;developer22;sales manager etci issue the following sql commandCOPY cust FROM 'C:\Program Files\PostgreSQL\9.1\customers.txt' WITH DELIMITER ';' ;and i get an errorERROR: invalid input syntax for integer: "13"SQL state: 22P02i would appreciate if you could help mebest regards and a happy new year!:) I have no experience using text mode but have you tried CSV Mode?e.g.COPY cust FROM 'C:\Program Files\PostgreSQL\9.1\ customers.txt' WITH DELIMITER ';' CSV ;HTH, happy new year.-- Craig() ascii ribbon campaign - against html mail/\
Hi,On 1 January 2012 14:01, avalon78 geek <avalon78.gr@gmail.com> wrote: hi guys,i am new to pgsql and i am facing a strange problem which i cannot solve.i want to import data from a txt file to the table custthe table is CREATE TABLE cust( custid integer NOT NULL, custOccupation varchar(30) NOT NULL, PRIMARY KEY(custid)} and the txt file contains13;developer22;sales manager etci issue the following sql commandCOPY cust FROM 'C:\Program Files\PostgreSQL\9.1\customers.txt' WITH DELIMITER ';' ;and i get an errorERROR: invalid input syntax for integer: "13"SQL state: 22P02i would appreciate if you could help mebest regards and a happy new year!:) I have no experience using text mode but have you tried CSV Mode?e.g.COPY cust FROM 'C:\Program Files\PostgreSQL\9.1\ customers.txt' WITH DELIMITER ';' CSV ;HTH, happy new year.-- Craig() ascii ribbon campaign - against html mail/\
hi guys,i am new to pgsql and i am facing a strange problem which i cannot solve.i want to import data from a txt file to the table custthe table is CREATE TABLE cust( custid integer NOT NULL, custOccupation varchar(30) NOT NULL, PRIMARY KEY(custid)} and the txt file contains13;developer22;sales manager etci issue the following sql commandCOPY cust FROM 'C:\Program Files\PostgreSQL\9.1\customers.txt' WITH DELIMITER ';' ;and i get an errorERROR: invalid input syntax for integer: "13"SQL state: 22P02i would appreciate if you could help mebest regards and a happy new year!:)
customers.txt' WITH DELIMITER ';' CSV ;
pgsql-novice by date:
Соглашаюсь с условиями обработки персональных данных