· 8 years ago · Jun 03, 2018, 10:56 AM
1CREATE TABLE IF NOT EXISTS test (symbol VARCHAR(16), ts timestamp)
2
3[('AAPL',1528004700), ('AAPL', 1528005600)]
4
5insert into test VALUES %s
6
7psycopg2.extras.execute_values(cursor, insert_stmt, [('AAPL',1528004700), ('AAPL', 1528005600)])
8
9ProgrammingError: column "ts" is of type timestamp without time zone but expression is of type integer
10LINE 1: insert into test VALUES ('AAPL',1528004700),('AAPL',15280056...
11 ^
12HINT: You will need to rewrite or cast the expression.