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

From tango ward
Subject psycopg2.DataError: invalid input syntax for integer: ""
Date
Msg-id CAA6wQLJjNYtnXwQR14TtSK2eEAVmxy-zc-Uy1zqQYOF56VqxvQ@mail.gmail.com
Whole thread Raw
Responses Re: psycopg2.DataError: invalid input syntax for integer: ""
List 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

pgsql-general by date:

Previous
From: Melvin Davidson
Date:
Subject: Re: Add schema to the query
Next
From: "David G. Johnston"
Date:
Subject: Re: psycopg2.DataError: invalid input syntax for integer: ""