I have the following code
pg_con = conns.con_to_pg()
cur = pg_con.cursor()
with open('up_md.csv', 'r') as f:
next(f) # Skip the header row.
tbl = 'bidba.upmeta'
cur.copy_from(f, tbl, 'csv', sep=',')
pg_con.commit()
The schema and table bidba.upmeta
exist in my postgres db.
No matter what I do, I get the message: relation "bidba.upmeta" does not exist
error.
I tried writing it with single quotes, double quotes, without quotes.
Nothing helps. What am I missing? Is there an issue with the copy_from
method?