Re: Type conversion from TEXT to DOUBLE PRECISION

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Type conversion from TEXT to DOUBLE PRECISION
Дата
Msg-id 23739.1073660245@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Type conversion from TEXT to DOUBLE PRECISION  (Richard Huxton <dev@archonet.com>)
Ответы Re: Type conversion from TEXT to DOUBLE PRECISION
Список pgsql-sql
Richard Huxton <dev@archonet.com> writes:
> Since your error seems to be complaining about a space, I'd guess you've got 
> other than numeric values in _aaa.

In fact, with a bit of experimentation I see the same error message:

regression=# select to_number('12345', '99999');to_number
-----------    12345
(1 row)

regression=# select to_number('1234 ', '99999');to_number
-----------     1234
(1 row)

regression=# select to_number(' 1234', '99999');to_number
-----------     1234
(1 row)

regression=# select to_number('     ', '99999');
ERROR:  invalid input syntax for type numeric: " "
regression=# select to_number('zzzzz', '99999');
ERROR:  invalid input syntax for type numeric: " "
regression=#

The error message's report of the input string seems a tad misleading,
especially in the last case.  (Karel, is this fixable?)  But anyway,
it sure looks like the problem is bad input data.
        regards, tom lane


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

Предыдущее
От: Michael Glaesemann
Дата:
Сообщение: Re: Missing data for column
Следующее
От: Daniel Lau
Дата:
Сообщение: Re: Type conversion from TEXT to DOUBLE PRECISION