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

From: tango ward <tangoward15(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: psycopg2.DataError: invalid input syntax for integer: ""
Date: 2018-05-07 03:37:30
Message-ID: CAA6wQLJjNYtnXwQR14TtSK2eEAVmxy-zc-Uy1zqQYOF56VqxvQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Good day to all,

I need advice on how to solve this problem. I am new to this kind of task.
I want to insert data into my PostgreSQL DB. The field that I will store
data is a textfield but I am getting an error invalid input syntax for
integer: ""

My code so far is this:

cur_p.execute("""
INSERT INTO a_recipient (created, mod, agreed, address, honor,)
VALUES (%s, %s)""", (current_timestamp,
current_timestamp, current_timestamp, '', ''))

If I remove the agreed and the last current_timestamp, it works fine as
well if I remove the honor which is a textfield and leave the 3
current_timestamp. I don't know if it is the date field with time and
timezone or the textfield which is having an issue.

I've read some related threads in SO but the ones I saw were either related
to CSV or Flask related.

Any suggestions please?

Thanks,
J

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2018-05-07 03:47:23 Re: psycopg2.DataError: invalid input syntax for integer: ""
Previous Message Melvin Davidson 2018-05-07 02:37:57 Re: Add schema to the query