I am trying to insert data into a table. When I try to insert an empty string into a Textfield, I am getting the invalid input syntax for integer
error message.
Other textfields work fine with empty string.
My code:
cur_p.execute("""
INSERT INTO a_recipient (created, mod, agreed, address, honor)
VALUES (current_timestamp, current_timestamp, current_timestamp, %s, %s)""", (None, None))
psycopg2.DataError: invalid input syntax for integer: ""
LINE 35: ... '', ''..
The code works fine if I remove the last current_timestamp
in the values as well as the agreed
but if I put it back, the error message re-appears.
I checked other threads opened here in SO, I found this but the problem was about the values in array input error: integer
Any advice?