Re: [GENERAL] PostgreSQL query failed: ERROR: pg_atoi: zero-length

Поиск
Список
Период
Сортировка
От Joshua D. Drake
Тема Re: [GENERAL] PostgreSQL query failed: ERROR: pg_atoi: zero-length
Дата
Msg-id 3F705E12.4080603@commandprompt.com
обсуждение исходный текст
Ответ на Re: [GENERAL] PostgreSQL query failed: ERROR: pg_atoi: zero-length  ("Nigel J. Andrews" <nandrews@investsystems.co.uk>)
Список pgsql-admin
>Looks like line 73 of your /xxx/database.inc PHP script is submitting a query
>formated with a zero length string instead of a number. Look for the variable
>being formated into the query string being undefined thereby leading to the
>somethat that looks like:
>
>  delete from aaa where id =
>
>instead of a more normal:
>
>  delete from aaa where id = 44
>
>You wouldn't believe the number of times I've explained that error message to a
>PHP developer.
>
>

Older versions of PostgreSQL would allow a '' to be inserted as an
integer base value which is illegal. Newer
versions do not allow a '' to be inserted into a integer base value.
Thus if you have a query that may return
'' as an integer base value, you should run it through a condition to
make the '' == NULL which is valid.

Sincerely,

Joshua Drake








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

Предыдущее
От: "Nigel J. Andrews"
Дата:
Сообщение: Re: [GENERAL] PostgreSQL query failed: ERROR: pg_atoi: zero-length
Следующее
От: aturner@neteconomist.com
Дата:
Сообщение: Re: steps to ensure referential integrity