I have a problem copying CSV files from a network shared drive into postgreSQL, at present the fix is to copy the files to a local drive first, but it's another process in a chain which is becoming too messy.
If I run the following command
COPY test_schema.test FROM 'X:\_Postgres DBs\Testing\test_file.csv' CSV HEADER;
ERROR: could not open file "X:\_Postgres DBs\Testing\test_file.csv" for reading: No such file or directory
ok, so postgreSQL Server doesn't understand windows mapped drives, fine, but if I run:
COPY test_schema.test FROM '\\ws7.domain.com\share-name\_Postgres DBs\Testing\test_file2.csv' CSV HEADER;
ERROR: could not open file "\\ws7.domain.com\share-name\_Postgres DBs\Testing\test_file2.csv" for reading: Permission denied
the file test_file2.csv can be opened locally on the same server with eg notepad/notepad++/wordpad so it doesn't look like there are any file attributes such as 'file in use'
Anyone have any tips how to use COPY with shared network drives? (Our DB UI is coded in Delphi so I'm looking for ways to do with with postgresql scripts I can call from Delphi otherwise I'll have to write some fiddly Delphi Firedac batchcopy method.)