Open nanounanue opened 7 years ago
Is there a way to force it to use \copy
or even better, make it an option?
Any ideas on this?
I would like to use odo to copy local CSV to a dockerized postgres. I have a host directory mounted to the container but this has different paths internally and externally. I get same errors as the OP.
@josh-gree I have a similar issue, trying to run a script in a Jupyter notebook that has datafiles local to that container load data into docker-compose connected db container.
Workaround for now is to mount the data files into the db container.
Hi
I have a
csv
file in my local disk:data/myfile.csv
, and apostgresql
database in another machine.When I try to run
odo("data/myfile.csv", "postgresql://user:password@some_ip:54322::tbl")
, whereuser
,password
,some_ip
andtbl
have the right values, I got the following:I noted two things with this error:
First
odo
is converting my relative path to an absolute path using (I guess) the information of my current directory (maybe withos
?)odo
is usingCOPY
instead of\copy
this means that the file must be in the server diskSo I copied the file to the server (to the directory
/tmp/raw-data/
), and I tried again:odo("/tmp/raw-data/myfile.csv", "postgresql://user:password@some_ip:54322::tbl")
and I got(NOTE that my
raw-data
doesn' t exist in my local machine)This not work either.
Then, finally I created in my local machine the directory
/tmp/raw-data
and copied the file there. Then everything works. So, my guess is thatodo
is mixing the paths, I mean, it is creating the path from the local machine, even when he is trying to load from the remote machine...This smells like a bug...