From: Jeff Eckermann <jeckermann@verio.net>
To: 'Bhuvan A' <bhuvanbk@yahoo.com>
Cc: pgsql-sql@postgresql.org
Subject: RE: While Using COPY COMMAND ...
Date: Fri, 6 Jul 2001 08:39:19 -0500
Message-ID: <08CD1781F85AD4118E0800A0C9B8580B094B16@NEZU> (raw)
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: jeckermann@verio.net, bhuvanbk@yahoo.com
Subject: RE: While Using COPY COMMAND ...
In-Reply-To: <08CD1781F85AD4118E0800A0C9B8580B094B16@NEZU>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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