Re: Issue import (COPY) data by between miss lines - Mailing list pgsql-admin

From phuongnh2
Subject Re: Issue import (COPY) data by between miss lines
Date
Msg-id 1431060106393-5848403.post@n5.nabble.com
Whole thread Raw
In response to Re: Issue import (COPY) data by between miss lines  (phuongnh2 <phuongnh2@vng.com.vn>)
Responses Re: Issue import (COPY) data by between miss lines
List pgsql-admin
Hi Admin,
How to config postgres to result below ??

 CREATE TEMP TABLE foo (a bigint, b text);
-- input_file.txt --

 1    one
 2
 3    three    111
 four    4
 5    five
 error logging off
 COPY foo FROM 'input_file.txt';

 ERROR:  missing data for column "b"
 CONTEXT:  COPY foo, line 2: "2"

skip bad rows
 --skip bad rows
 COPY foo FROM 'input_file.txt' (ERROR_LOGGING,
ERROR_LOGGING_SKIP_BAD_ROWS);
 SELECT * FROM foo;

  a |  b
 ---+------
  1 | one
  5 | five
 (2 rows)




--
View this message in context:
http://postgresql.nabble.com/Issue-import-COPY-data-by-between-miss-lines-tp5848263p5848403.html
Sent from the PostgreSQL - admin mailing list archive at Nabble.com.


pgsql-admin by date:

Previous
From: phuongnh2
Date:
Subject: Re: Issue import (COPY) data by between miss lines
Next
From: Geoff Winkless
Date:
Subject: Re: [HACKERS] INSERT ... ON CONFLICT UPDATE/IGNORE 4.0