Re: COPY fails to read source file

From: Lincoln Yeoh <lylyeoh(at)mecomb(dot)com>
To: Bill Barnes <bbarnes(at)operamail(dot)com>, postgres general mail list <pgsql-general(at)postgresql(dot)org>
Subject: Re: COPY fails to read source file
Date: 2000-05-17 10:17:11
Message-ID: 3.0.5.32.20000517181711.008feb90@pop.mecomb.po.my
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I believe when you use the sql style COPY, the database engine is the one
going out to fetch your file, using the backend UID and associated
permissions.

Whereas if you use the psql \copy, it's using the UID and perms of what you
are running psql as.

If the database engine cannot reach the file through the filesystem tree,
it can't copy it.

Cheerio,
Link.

At 01:57 PM 16-05-2000 -0400, Bill Barnes wrote:
>Hello all:
>
>Using 6.5.3, SuSE 6.4, logged in as 'billb'.
>
>Here are 2 instances of the COPY command;
>
>-----------------------------------------------------------------------------
>copy custprofile from '/home/billb/custpr.txt' using delimiters ';';
>The result is:
> ERROR: COPY command, running in backend with with effective uid 26, could
> not open '/home/billb/custpr.txt' for reading. Errno = Permission denied
> (13).
>The file looks like
> -rw-r--r-- 1 billb users 58902 May 16 11:45 /home/billb/custpr.txt
>
>----------------------------------------------------------------------------
>copy custprofile from '/mnt/DOS_C/sybase/custpr.txt' using delimiters ';';
>The result is:
> COPY
>The file looks like
> -rwxr-xr-x 1 root root 58902 May 16 11.56
/mnt/DOS_C/sybase/custpr.txt
>
>---------------------------------------------------------------------------
>
>The second instance gave me the results I wanted, but why did the first
>instance fail? If anything, I would have expected permission denied on the
>root owner. I have had the same results on other ocassions.
>
>What am I missing?
>
>TIA
>Bill Barnes
>
>------------------------------------------------------------
>This e-mail has been sent to you courtesy of OperaMail, a
>free web-based service from Opera Software, makers of
>the award-winning Web Browser - http://www.operasoftware.com
>------------------------------------------------------------
>
>
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Marcin Inkielman 2000-05-17 11:42:33 Re: 7.0 psql, readline and history.
Previous Message Dragos Stoichita 2000-05-17 09:35:15 Re:simple question for users and db