pg import text data to not null table comma error but semicolon right

From: 王学敏 <15810475206(at)163(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: pg import text data to not null table comma error but semicolon right
Date: 2014-06-26 12:17:58
Message-ID: 5df41de4.194e2.146d81c6872.Coremail.15810475206@163.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi,
when i imort data from csv to table ,there may be some error
create table t(d1 text not null,d2 text not null,d3 text not null);

\copy t(d1,d2,d3) from 'comma.text' with delimiter ',';
ERROR: missing data for column "d2"
CONTEXT: COPY t, line 1: "a;b;c"

\copy t(d1,d2,d3) from 'semicolon.text' with delimiter ';' ;
--no error
cat comma.text
a,b,c
e,,f

cat semicolon.text
a;b;c
e;;f

Browse pgsql-bugs by date

  From Date Subject
Next Message 王学敏 2014-06-26 12:24:40 pg import text data to not null table comma error but semicolon right
Previous Message Alvaro Herrera 2014-06-26 04:45:19 Re: Re: [BUGS] BUG #8673: Could not open file "pg_multixact/members/xxxx" on slave during hot_standby