Let's say if I execute the following command.
insert into hello (username) values ('me')
and I ran like
cursor.fetchall()
I get the following error
psycopg2.ProgrammingError: no results to fetch
How can I detect whether to call fetchall() or not without checking the query is "insert" or "select"?
Thanks.