I have a got the path to a csv file using
cur1.execute("select path from t2");
path = cur1.fetchone()
I know want to perform a copy to the csv file using psycopg2 which goes like :
cur2.execute("COPY (SELECT id,a,b,c FROM t1,t2 WHERE a >= t2.d ) TO path[0] DELIMITER ',' CSV;")
I am getting this error: psycopg2.ProgrammingError: syntax error at or near "path"
Thanks in advance!