Invalid input syntax for integer

Поиск
Список
Период
Сортировка
От Hans Edwin Winzeler
Тема Invalid input syntax for integer
Дата
Msg-id CABq1rrK9ao24fuMUHRtvN7oyTpTq-tGtZyzoEqnOn3Onznoc_g@mail.gmail.com
обсуждение исходный текст
Ответы Re: Invalid input syntax for integer  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Invalid input syntax for integer  ("Jean-Yves F. Barbier" <12ukwn@gmail.com>)
Re: Invalid input syntax for integer  ("Jean-Yves F. Barbier" <12ukwn@gmail.com>)
Список pgsql-novice
Hello,

I am new to PostgreSQL and have a data format issue that I can't resolve.

The input table from my .csv file (about 10 million records) that I am importing into PostgreSQL from a different program gives numbers in a format as follows, for example: 0-1788.000000 to indicate the value -1788. PostgreSQL gives me the error "invalid input syntax for integer" when I try to import the number (or invalid for numeric, real, double precision, etc. when I try to import it in those other formats). When I specify varchar(20) I get no problems and can import it, but then I can't use it numerically. How do I either:

  • Import the value as NUMERIC or INTEGER or REAL or FLOAT or something that I can use as a value rather than text, OR
  • How do I convert the varchar(20) that I have already imported into a numeric value?
Thanks

Edwin Winzeler

В списке pgsql-novice по дате отправления:

Предыдущее
От: Don Parris
Дата:
Сообщение: Re: Stuck Up In My Category Tree
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Invalid input syntax for integer