I'm trying to upload files to a PostgreSQL database from my local computer, the error I get is:
sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) could not open file "C:\Mar-2015.csv" for reading: No such file or directory
The command that I'm trying to run is:
pcon = 'postgresql://user:password@ipaddress:5432/dbname::tablename'
path = os.path.normpath(
'C:/Mar-2015.csv'))
o.odo(path, pcon, sep='|')
It looks like PostgreSQL is trying to find the file on the remote server rather than on the local machine. Running the script on the server (and changing the file path to a location on the server) runs fine, which seems to confirm my suspicion.
Is it possible to use odo to upload a file from my local machine to a remote PostgreSQL machine? I'm using Amazon RDS.