pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: scott.marlowe <scott.marlowe@ihs.com>
To: Sebastian Tewes <stewes@tewes.homelinux.net>
Cc: pgsql-sql@postgresql.org
Subject: Re: invalid input syntax for integer: ""
Date: Tue, 4 May 2004 08:58:25 -0600 (MDT)
Message-ID: <Pine.LNX.4.33.0405040857010.30999-100000@css120.ihs.com> (raw)
In-Reply-To: <000801c42f04$ba09b6f0$0a0010ac@2864id>

On Sat, 1 May 2004, Sebastian Tewes wrote:

> Hello :-)
> 
> got a little prob... 
> 
> so my table 
> 
> create table warengruppen ( kennung char (1),
>                                 holder int,
>                      HauptWarenGruppe int,
>                         BezHWG varchar (50),
>                           WarenGruppe int,
>                          BezWG varchar (50));
> 
> 
> the copy syntax 
> 
> copy warengruppen FROM '/usr/pgsql/datanorm.wrg' with DELIMITER ';';
> 
> and a smal part of my 'datanorm.wrg'
> 
> 
> S;;011;Dachsteine+Formst.;;;
> S;;011;;0111;Dachst.glatt(Biber);
> S;;011;;0112;Dachst.glatt(Tegal.);

the problem here is that "" is not an integer. 

0 is.  If you were to write a simple script file to process the input file 
and turn the empty fields into 0s where they should be because they're 
integers you're set.

OR, you can build a temp table with all text columns, import into that, 
then use a select query to change the blank text columns to the character 
0, then import that into the target table.




view thread (2+ messages)

Message-ID: <Pine.LNX.4.33.0405040857010.30999-100000@css120.ihs.com>
Permalink:  ../Pine.LNX.4.33.0405040857010.30999-100000@css120.ihs.com/
Also on:    postgresql.org/message-id/Pine.LNX.4.33.0405040857010.30999-100000@css120.ihs.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: scott.marlowe@ihs.com, stewes@tewes.homelinux.net
  Subject: Re: invalid input syntax for integer: ""
  In-Reply-To: <Pine.LNX.4.33.0405040857010.30999-100000@css120.ihs.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox