![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I am trying to load a file into a database. The file in part looks like this. 10000,Citizens Bank Checking Account,0,TRUE 10001,Peoples Bank Operating Account,0,FALSE I issue a copy command as follows and get the error as shown. # copy myschema.tbl_account from '/dirname/Account.csv' with delimiter ','; 'RROR: copy: line 1, Bad boolean external representation 'TRUE IPADB=# |
#3
| |||
| |||
|
|
I'd guess that there's a carriage return at the end of line 1. |
|
You might need to run your data through a filter before importing it into PostgreSQL. Some systems have a dos2unix program; you could also use tr, sed, perl, awk, etc. to strip trailing carriage returns. |
#4
| |||
| |||
|
|
Michael Fuhr <mike (AT) fuhr (DOT) org> writes: I'd guess that there's a carriage return at the end of line 1. Looks like that to me too. You might need to run your data through a filter before importing it into PostgreSQL. Some systems have a dos2unix program; you could also use tr, sed, perl, awk, etc. to strip trailing carriage returns. Alternatively, update to PG 7.4 or later. Since 7.4 COPY will attempt to Do The Right Thing with files containing Windows-style newlines. regards, tom lane |
![]() |
| Thread Tools | |
| Display Modes | |
| |