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

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: tango ward <tangoward15(at)gmail(dot)com>
Cc: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: psycopg2.DataError: invalid input syntax for integer: ""
Date: 2018-05-07 03:47:23
Message-ID: CAKFQuwafnE4hCacPP25kcAH6dRzuf7kBdBDd8JJptDBC8PqdLQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sunday, May 6, 2018, tango ward <tangoward15(at)gmail(dot)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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Igor Korot 2018-05-07 04:02:11 Re: Add schema to the query
Previous Message tango ward 2018-05-07 03:37:30 psycopg2.DataError: invalid input syntax for integer: ""