Re: PostgreSQL COPY Statement Error On Linux

From: Francisco Olarte <folarte(at)peoplecall(dot)com>
To: George Neuner <gneuner2(at)comcast(dot)net>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: PostgreSQL COPY Statement Error On Linux
Date: 2017-09-12 17:43:33
Message-ID: CA+bJJby-N49qifYNOiK0Kkp3VgdjxQ9X1kfs9yy4jyLksr=nGg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

George:

On Tue, Sep 12, 2017 at 6:40 PM, George Neuner <gneuner2(at)comcast(dot)net> wrote:
> Francisco already pointed out that Linux doesn't understand the
> backslashes in the file path, however it should be noted that Windows
> *does* understand forward slashes and that [modulo disk names in
> Windows] you can use forward slash paths on both systems.

That's not strictly correct. Linus understand backslahes in paths
fine, they are just not a directory separator ( there are only two
reserved byte values in path names, IIRC, slash for dir sep and nul
for string end, C issues ). Windows, OTOH, inherits path separator
logic from MSDOS 2.0, and if it hasn't changed in the last fifteen
years treats any slash as a separator.

But the issue is that windos treats a \\netname\resource prefix as a
network request, and transform it internally, while linux does not. In
*ix you have to connect to
the machine and mount its resources first, similarly to what you do
with local disks. Normally //x is treated the same as /x, or as ////x:

folarte(at)n:~$ ls -ldi /tmp //tmp ///tmp
655361 drwxrwxrwt 14 root root 45056 Sep 12 19:17 /tmp
655361 drwxrwxrwt 14 root root 45056 Sep 12 19:17 //tmp
655361 drwxrwxrwt 14 root root 45056 Sep 12 19:17 ///tmp

Francisco Olarte.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message kbrannen 2017-09-12 18:40:36 Re: Perl script is killed by SIGPIPE
Previous Message George Neuner 2017-09-12 16:40:21 Re: PostgreSQL COPY Statement Error On Linux