Re: psycopg2.DataError: invalid input syntax for integer: "" - Mailing list pgsql-general

From David G. Johnston
Subject Re: psycopg2.DataError: invalid input syntax for integer: ""
Date
Msg-id CAKFQuwafnE4hCacPP25kcAH6dRzuf7kBdBDd8JJptDBC8PqdLQ@mail.gmail.com
Whole thread Raw
In response to psycopg2.DataError: invalid input syntax for integer: ""  (tango ward <tangoward15@gmail.com>)
List 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 by date:

Previous
From: tango ward
Date:
Subject: psycopg2.DataError: invalid input syntax for integer: ""
Next
From: Igor Korot
Date:
Subject: Re: Add schema to the query