Trying to load a file into a database on virtual machine I have set up a Postgres db on a linux vm and have been having no issues using a GUI to connect to it. However, I am trying to load a large, 32GB, file onto it and so am skeptical of the old way I was doing as it takes a lot of bandwith. I set up a dropbox folder to sync on the VM, which it has, and tried to COPY the file and got error message: 

ERROR:  could not open file "~/Dropbox/0ptimus-Jaspin/nation/VoterMapping--NH--03-17-2014-HEADERS.tab" for reading: No such file or directory


I used the following to try to do the copy:

COPY nh FROM '/Dropbox/0ptimus-Jaspin/VoterMapping--NH--03-17-2014-HEADERS.tab';


Thanks!
COPY doesn't understand the shell-script shorthand ~ for "my home directory". You must specify the path explicitly, e.g.

COPY nh FROM '/home/MYUSERNAME/Dropbox/0ptimus-Jaspin/VoterMapping--NH--03-17-2014-HEADERS.tab';


at which point you'll probably get a "permission denied" error, because COPY runs as the postgresql server user, which can't normally read files from user homedirs. If you're on RHEL/CentOS/Fedora then setting permissions won't be enough, you'll need to change SELinux rights too.

Instead, I suggest using \copy from psql.

cd ~
psql
\copy nh FROM 'Dropbox/0ptimus-Jaspin/VoterMapping--NH--03-17-2014-HEADERS.tab';