[ic] Importing tab-delimited file into Postgres fails
Jon Jensen
jon at endpoint.com
Mon Nov 1 13:05:21 EST 2004
On Mon, 1 Nov 2004, Rene Hertell wrote:
> I have a tab-delimited file that I would need to reimport into an empty
> postgres table, but it fails with the following error:
>
> [01/November/2004:13:14:34 +0200] - - set_row error: ERROR: invalid
> input syntax for integer: ""
> [01/November/2004:13:14:34 +0200] - - table 'tittelit' failed: tittelit
> import into failed: set_row error: ERROR: invalid input syntax for
> integer: "" at /usr/local/interchange/lib/Vend/Table/DBI.pm line 1391.
>
> My code-field (primary key) is an auto sequence field, and the rows I
> want to reimport have this value already set... I guess that this
> import-process does not work because of this...
I don't think that's your problem. The error message spells it out: your
field "tittelit" is an integer field, but you're trying to import an empty
string, which isn't valid. You need to import either a number or a NULL.
In Interchange's database configuration try the PREFER_NULL setting for
that field. Or use PostgreSQL's native COPY command and put \N in that
field where you want it to be null.
Jon
--
Jon Jensen
End Point Corporation
http://www.endpoint.com/
Software development with Interchange, Perl, PostgreSQL, Apache, Linux, ...
More information about the interchange-users
mailing list