I'm using psycopg3 and PostgreSQL 14. When I run a copy or exec function, and include a ON argument, it gives me the error psycopg.errors.SyntaxError: syntax error at or near "ON"
I have tried two different functions, both resulting in the same error.
cur.execute("""
CREATE TABLE temp_mls AS TABLE mls_properties WITH NO DATA
ON COMMIT DROP
""")
and
cur.copy("""COPY mls_properties (fips_code") FROM STDIN
ON CONFLICT DO NOTHING
""")