Re: psycopg2.DataError: invalid input syntax for integer: ""

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: psycopg2.DataError: invalid input syntax for integer: ""
Дата
Msg-id CAKFQuwafnE4hCacPP25kcAH6dRzuf7kBdBDd8JJptDBC8PqdLQ@mail.gmail.com
обсуждение исходный текст
Ответ на psycopg2.DataError: invalid input syntax for integer: ""  (tango ward <tangoward15@gmail.com>)
Список pgsql-general
On Sunday, May 6, 2018, tango ward <tangoward15@gmail.com> wrote:
cur_p.execute("""
                INSERT INTO a_recipient (created, mod, agreed, address, honor,)               VALUES (%s, %s)""", (current_timestamp, current_timestamp, current_timestamp, '', ''))

That code doesn't even run (extra comma after honor, not enough columns in values).  Provide working code and the definition of a_recipient.

In short, you've passed an empty string to an integer column, which doesn't work.  Supply null or pass a number.

David J.

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

Предыдущее
От: tango ward
Дата:
Сообщение: psycopg2.DataError: invalid input syntax for integer: ""
Следующее
От: Igor Korot
Дата:
Сообщение: Re: Add schema to the query