Re: could not open file xxxx for writing: Permission denied

From: "Magnus Hagander" <magnus(at)hagander(dot)net>
To: lanczos(at)t-zones(dot)sk
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: could not open file xxxx for writing: Permission denied
Date: 2007-01-04 06:45:29
Message-ID: 20070104064543.26CC4DCC10A@svr2.hagander.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> Hello,
>
> Using PostgreSQL 8.1.4, pgadmin III 1.6.0 in WinXP I tried to export a table
> using COPY (first time in postgresql, did many times in Sybase):
>
> COPY ml50jtsk_datum_v TO 'c:/postgresql/ml50jtsk.out';
>
> I got the following errormessage:
>
> ERROR: could not open file "c:/postgresql/ml50jtsk.out" for writing:
> Permission denied
> SQL state: 42501
>
> What's wrong? Does it mean that the database user has no writing permission
> out of the database? How I did a pg_dump then few weeks ago?

Yes, that's what it means. pg_dump works because it uses the clients account, but copy uses the servers. To use client permissions with copy in psql, use \copy
instead.

/Magnus

In response to

Browse pgsql-general by date

  From Date Subject
Next Message novnov 2007-01-04 07:33:35 Re: Generic timestamp function for updates where field
Previous Message sbaskar 2007-01-04 05:51:13 Need help in PGSQL