0

I have been trying to learn postgresql. I just wanted to have my hands dirty with sql on postgresql. However, I am finding it difficult to import a csv file with 67 columns into postgresql. Since one is required to manually create a table and for large number of columns. One cannot do this. While going through stackoverflow I had seen this solution:

from sqlalchemy import create_engine
engine = create_engine(r'postgresql://postgres:Katherin@413@localhost:5432/covid_deaths')
df.to_sql('covid_deaths_owid', engine)

This is giving me the following error:

OperationalError: (psycopg2.OperationalError) could not translate host name "413@localhost" to address: Unknown server error

Is there any easiest and convenient way to load a csv file into postgres????

Sam
  • 41
  • 6

0 Answers0