Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

COPY_FROM failing UndefinedTable: relation "<schema name>.<table name>" does not exist, post 2.9.1 release #1302

Closed
vtiwary opened this issue Jun 20, 2021 · 3 comments

Comments

@vtiwary
Copy link

vtiwary commented Jun 20, 2021

Post release of psycopg2==2.9.1, Copy_from functionality is failing with error
COPY_FROM throws error UndefinedTable: relation ".

" does not exist
below is the code
cursor.copy_from(sio, table='TestSchema.TestTable', columns=list(df.columns), sep=',')
It works fine with psycopg2==2.8.6

@dvarrazzo
Copy link
Member

See #1294

@vtiwary
Copy link
Author

vtiwary commented Jun 20, 2021

Many thanks. Incase someone has already extensively used Copy_From (like me), I believe adding below will help avoid making lots of code changes
cursor.execute("SET search_path = Schema_Name")

@QiwenZheng1234
Copy link

@vtiwary I'm not familiar with these, but did you mean adding cursor.execute("SET search_path = Schema_Name") before or after cursor.copy_from(...)? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants