Re: Issue import (COPY) data by between miss lines

From: phuongnh2 <phuongnh2(at)vng(dot)com(dot)vn>
To: pgsql-admin(at)postgresql(dot)org
Subject: Re: Issue import (COPY) data by between miss lines
Date: 2015-05-08 04:41:46
Message-ID: 1431060106393-5848403.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Wei Shan 2015-05-08 06:38:20 Schema Consolidation in PostgreSQL
Previous Message Gilberto Castillo 2015-05-07 18:02:53 Re: connect postgresql to a different cluster