Обсуждение: Unable to use COPY..FROM with NULL numeric fields

Поиск
Список
Период
Сортировка

Unable to use COPY..FROM with NULL numeric fields

От
"Nikh Nath"
Дата:
Hi,

I am trying to use the following command to import a file into pgsql.

    COPY acct FROM '/home/megasys/acct.dmp.new' USING DELIMITERS
'\t' WITH NULL AS '\N';

I keep getting this error.

ERROR:  copy: line 1, Bad numeric input format '\N'

All the numeric fields in the table can be NULL ..

Where does the problem lie?? Cannot numeric fields be NULL in copy
command?

I have just decided to migrate from mysql to pgsql ......and already it
seems very hard to deal with this database....

Any help will be appreciated..

Thanks



==================================
Nikhilesh Nath
Project Manager ( I.T. )
Westlake Financial Services
Work  : 323.692.4129
Fax   : 323.692.4129
Email : nnath@westlakefinancial.com

Re: Unable to use COPY..FROM with NULL numeric fields

От
eric soroos
Дата:
On Tue, 29 Oct 2002 16:34:55 -0800 in message
<E936C9C6709EF340B2B00D779FD59CF703BE2D2D@nowexchange.HANKEYINVESTMENTS.COM>,"Nikh Nath" <nnath@westlakefinancial.com>
wrote:
> Hi,
>
> I am trying to use the following command to import a file into pgsql.
>
>     COPY acct FROM '/home/megasys/acct.dmp.new' USING DELIMITERS
> '\t' WITH NULL AS '\N';
>
> I keep getting this error.
>
> ERROR:  copy: line 1, Bad numeric input format '\N'
>

Try:

    COPY acct FROM '/home/megasys/acct.dmp.new' USING DELIMITERS '\t' WITH NULL AS '\\N';

eric



Re: Unable to use COPY..FROM with NULL numeric fields

От
"Nikh Nath"
Дата:
That changed the error message to :

megasys=# COPY acct FROM '/home/megasys/acct.dmp.new' USING DELIMITERS
'\t' WITH NULL AS '\\N';
ERROR:  copy: line 1, Bad numeric input format ''

Thanks
Nikh Nath

-----Original Message-----
From: eric soroos [mailto:eric-psql@soroos.net]
Sent: Tuesday, October 29, 2002 5:02 PM
To: pgsql-novice@postgresql.org
Subject: Re: [NOVICE] Unable to use COPY..FROM with NULL numeric fields


On Tue, 29 Oct 2002 16:34:55 -0800 in message
<E936C9C6709EF340B2B00D779FD59CF703BE2D2D@nowexchange.HANKEYINVESTMENTS.
COM>, "Nikh Nath" <nnath@westlakefinancial.com> wrote:
> Hi,
>
> I am trying to use the following command to import a file into pgsql.
>
>     COPY acct FROM '/home/megasys/acct.dmp.new' USING DELIMITERS
'\t'
> WITH NULL AS '\N';
>
> I keep getting this error.
>
> ERROR:  copy: line 1, Bad numeric input format '\N'
>

Try:

    COPY acct FROM '/home/megasys/acct.dmp.new' USING DELIMITERS
'\t' WITH NULL AS '\\N';

eric



---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)