pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedWhile Using COPY COMMAND ...
5+ messages / 4 participants
[nested] [flat]
* While Using COPY COMMAND ...
@ 2001-07-06 06:35 Bhuvan A <bhuvanbk@yahoo.com>
2001-07-06 08:41 ` Re: While Using COPY COMMAND ... Richard Huxton <dev@archonet.com>
2001-07-06 14:18 ` Re: While Using COPY COMMAND ... Peter Eisentraut <peter_e@gmx.net>
0 siblings, 2 replies; 5+ messages in thread
From: Bhuvan A @ 2001-07-06 06:35 UTC (permalink / raw)
To: pgsql-sql
hello sirs,,
I am using PSQL client. I can able to copy the contents of a
table to '/tmp/' directory. But Why can't i able to copy
contents of a table to my home directory?
But, i can redirect the output of a command (\o) to a file
in my home directory.. How it gets succeed while the prev.
doesn't????
For your clarifications, here is the workflow.
bhuvan=# copy f_addr_phones with oids to
'/home/bhuvan/fap-table';
ERROR: COPY command, running in backend with effective uid
1015, could not open file '/home/bhuvan/fap-table' for
writing. Errno = Permission denied (13).
bhuvan=# copy f_addr_phones with oids to '/tmp/fap-table';
COPY
bhuvan=#
------
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: While Using COPY COMMAND ...
2001-07-06 06:35 While Using COPY COMMAND ... Bhuvan A <bhuvanbk@yahoo.com>
@ 2001-07-06 08:41 ` Richard Huxton <dev@archonet.com>
1 sibling, 0 replies; 5+ messages in thread
From: Richard Huxton @ 2001-07-06 08:41 UTC (permalink / raw)
To: Bhuvan A <bhuvanbk@yahoo.com>; pgsql-sql
From: "Bhuvan A" <bhuvanbk@yahoo.com>
> hello sirs,,
>
> I am using PSQL client. I can able to copy the contents of a
> table to '/tmp/' directory. But Why can't i able to copy
> contents of a table to my home directory?
>
> But, i can redirect the output of a command (\o) to a file
> in my home directory.. How it gets succeed while the prev.
> doesn't????
>
> For your clarifications, here is the workflow.
>
>
> bhuvan=# copy f_addr_phones with oids to
> '/home/bhuvan/fap-table';
> ERROR: COPY command, running in backend with effective uid
> 1015, could not open file '/home/bhuvan/fap-table' for
The "copy" command runs in the backend as user postgres (uid 1015) who quite
rightly doesn't have access to your home directory
Look into \copy instead - that acts from the client, so has your
permissions.
HTH
- Richard Huxton
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: While Using COPY COMMAND ...
2001-07-06 06:35 While Using COPY COMMAND ... Bhuvan A <bhuvanbk@yahoo.com>
@ 2001-07-06 14:18 ` Peter Eisentraut <peter_e@gmx.net>
1 sibling, 0 replies; 5+ messages in thread
From: Peter Eisentraut @ 2001-07-06 14:18 UTC (permalink / raw)
To: Bhuvan A <bhuvanbk@yahoo.com>; +Cc: pgsql-sql
Bhuvan A writes:
> bhuvan=# copy f_addr_phones with oids to
> '/home/bhuvan/fap-table';
> ERROR: COPY command, running in backend with effective uid
> 1015, could not open file '/home/bhuvan/fap-table' for
> writing. Errno = Permission denied (13).
The server is probably running under a different user id (postgres?).
--
Peter Eisentraut peter_e@gmx.net http://funkturm.homeip.net/~peter
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: While Using COPY COMMAND ...
@ 2001-07-06 08:38 Bhuvan A <bhuvanbk@yahoo.com>
0 siblings, 0 replies; 5+ messages in thread
From: Bhuvan A @ 2001-07-06 08:38 UTC (permalink / raw)
To: David Stanaway <david@netventures.com.au>; +Cc: pgsql-sql
hello sirs,,
the permission of '/tmp/' directory is
drwxrwxrwt 41 root root 12288 Jul 6 14:01 /tmp/
the permission of the file copied to '/tmp/' directory is
-rw-r--r-- 1 postgres users 399 Jul 6 12:01
/tmp/fap-table
Sir, as you mentioned if it is not possible to copy to a
home directory, then how can we able to redirect the result
of some queries to any possible file in home directory!!???
Example:
bhuvan=# \o select-output
bhuvan=# select * from stdcodes;
bhuvan=#
NOTE: I am really new to postgres, kindly apologize for any
inconvince in my submission.
Thanking you,
Yours truly,
Bhuvaneswar.
On Fri, 6 Jul 2001, David Stanaway wrote:
>
> On Friday, July 6, 2001, at 04:35 PM, Bhuvan A wrote:
>
> >
> > hello sirs,,
> >
> > I am using PSQL client. I can able to copy the contents of a
> > table to '/tmp/' directory. But Why can't i able to copy
> > contents of a table to my home directory?
>
> My guess is that user/group postgres can't write to your home directory.
>
> Who owns the file you copied to /tmp ?
>
> --
> Best Regards
> David Stanaway
> ========================.---------------------------------------------
> Technology Manager - Australia's Premier Internet Broadcasters
> david@NetVentures.com.au Office +612 9357 1699
> ========================'---------------------------------------------
>
^ permalink raw reply [nested|flat] 5+ messages in thread
* RE: While Using COPY COMMAND ...
@ 2001-07-06 13:39 Jeff Eckermann <jeckermann@verio.net>
0 siblings, 0 replies; 5+ messages in thread
From: Jeff Eckermann @ 2001-07-06 13:39 UTC (permalink / raw)
To: 'Bhuvan A' <bhuvanbk@yahoo.com>; +Cc: pgsql-sql
To clarify a little further...
psql (client application) runs with the permissions of the system user who
has called it, so psql has no difficulty in writing to that user's home
directory (or anywhere else that the user has write permission).
COPY is run by the backend, and therefore the backend user ("postgres")
needs permission to write to the target file.
Your choices are:
1. Adjust the permissions on your home directory
2. Use \copy instead: being a psql command, that runs with the same
permissions that psql has.
> -----Original Message-----
> From: Bhuvan A [SMTP:bhuvanbk@yahoo.com]
> Sent: Friday, July 06, 2001 3:39 AM
> To: David Stanaway
> Cc: pgsql-sql@postgresql.org
> Subject: Re: While Using COPY COMMAND ...
>
>
> hello sirs,,
>
> the permission of '/tmp/' directory is
> drwxrwxrwt 41 root root 12288 Jul 6 14:01 /tmp/
>
> the permission of the file copied to '/tmp/' directory is
> -rw-r--r-- 1 postgres users 399 Jul 6 12:01
> /tmp/fap-table
>
> Sir, as you mentioned if it is not possible to copy to a
> home directory, then how can we able to redirect the result
> of some queries to any possible file in home directory!!???
>
> Example:
>
> bhuvan=# \o select-output
> bhuvan=# select * from stdcodes;
> bhuvan=#
>
> NOTE: I am really new to postgres, kindly apologize for any
> inconvince in my submission.
>
> Thanking you,
>
> Yours truly,
> Bhuvaneswar.
>
> On Fri, 6 Jul 2001, David Stanaway wrote:
>
> >
> > On Friday, July 6, 2001, at 04:35 PM, Bhuvan A wrote:
> >
> > >
> > > hello sirs,,
> > >
> > > I am using PSQL client. I can able to copy the contents of a
> > > table to '/tmp/' directory. But Why can't i able to copy
> > > contents of a table to my home directory?
> >
> > My guess is that user/group postgres can't write to your home directory.
> >
> > Who owns the file you copied to /tmp ?
> >
> > --
> > Best Regards
> > David Stanaway
> > ========================.---------------------------------------------
> > Technology Manager - Australia's Premier Internet Broadcasters
> > david@NetVentures.com.au Office +612 9357 1699
> > ========================'---------------------------------------------
> >
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2001-07-06 14:18 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-07-06 06:35 While Using COPY COMMAND ... Bhuvan A <bhuvanbk@yahoo.com>
2001-07-06 08:41 ` Richard Huxton <dev@archonet.com>
2001-07-06 14:18 ` Peter Eisentraut <peter_e@gmx.net>
2001-07-06 08:38 Re: While Using COPY COMMAND ... Bhuvan A <bhuvanbk@yahoo.com>
2001-07-06 13:39 RE: While Using COPY COMMAND ... Jeff Eckermann <jeckermann@verio.net>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox