Re: COPY to question

From: Steve Atkins <steve(at)blighty(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: COPY to question
Date: 2017-01-17 18:33:10
Message-ID: 9A335492-279E-403F-9A40-68FB04A11ADD@blighty.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


> On Jan 17, 2017, at 10:23 AM, Rich Shepard <rshepard(at)appl-ecosys(dot)com> wrote:
>
> Running -9.6.1. I have a database created and owned by me, but cannot copy
> a table to my home directory. Postgres tells me it cannot write to that
> directory. The only way to copy tables to files is by doing so as the
> superuser (postgres).
>
> Why is this, and can I change something so I, as a user, can copy tables
> directly to ~/?

You can use "\copy" from psql to do the same thing as the SQL copy command,
but writing files as the user running psql, rather than the postgresql superuser
role. That's probably what you need.

Cheers,
Steve

In response to

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2017-01-17 18:40:10 Re: COPY to question
Previous Message Pavel Stehule 2017-01-17 18:31:22 Re: COPY to question