COPY could potentially work even if the database and the web server are on different machines, if the input file is accessible to the database server over NFS. Consider a scenario where you place the input files in /some-place on the web server and also mount that directory at /some-place on the database server. Then, if the user running the database (usually postgres) can access /some-place, you should be able to use COPY without problems.