I am using psycopg2 and how can I delete rows that are older than a certain date? For example:
cursor.execute('DELETE FROM datatable WHERE date < %s', datetime.date(2012, 1, 1))
If I write like this, there will be TypeError: 'datetime.date' object does not support indexing. How can I do with it? Thanks!
Pass the second argument as a list or a tuple: