Re: Copy command to handle view for my export requirement

Поиск
Список
Период
Сортировка
От Craig Ringer
Тема Re: Copy command to handle view for my export requirement
Дата
Msg-id 4E43CF2F.1030004@ringerc.id.au
обсуждение исходный текст
Ответ на Re: Copy command to handle view for my export requirement  (Siva Palanisamy <siva_p@hcl.com>)
Ответы Re: Copy command to handle view for my export requirement  (Raghavendra <raghavendra.rao@enterprisedb.com>)
Список pgsql-general
On 11/08/2011 7:56 PM, Siva Palanisamy wrote:

 > FYI, I am using PostgreSQL 8.1.4.

Argh, ogod why?!?!?!

That version is *totally* unsupported on Windows. Not only that, but
you're running an ancient point-release - you are missing *19* patch
releases worth of bug fixes. The latest point-release is 8.1.23 !

Here is a list of all the fixes you are missing out on:

   http://www.postgresql.org/docs/8.1/static/release.html

> I have installed Windows version of Postgres 9.0.4 in my windows machine to test the new copy command as detailed in
thebelow e-mails. When I run the command in SQL Editor, I got permission error. But I am running as an administrator. 
>
> COMMAND: copy (select * from employee) to 'C:/emp.csv'
> ERROR:  could not open file "C:/emp.csv" for writing: Permission denied
> ********** Error **********
> ERROR: could not open file "C:/emp.csv" for writing: Permission denied
> SQL state: 42501

The COPY command (as distinct from \copy) runs on the server-side so it
has the permissions of the "postgres" user. You must save the file
somewhere the "postgres" user as write access. Either create a folder
and give "full control" to the user "postgres", or write the export
within the existing postgresql data directory.

> COMMAND: \copy (select * from employee) to 'C:/emp.csv'
> ERROR:  syntax error at or near "\"
> LINE 1: \copy (select * from employee) to 'C:/emp.csv'

You are not using psql. "\copy" is a psql command. I don't think it's
supported by PgAdmin III, though I could be wrong.



--
Craig Ringer

В списке pgsql-general по дате отправления:

Предыдущее
От: Raghavendra
Дата:
Сообщение: Re: Copy command to handle view for my export requirement
Следующее
От: Raghavendra
Дата:
Сообщение: Re: Copy command to handle view for my export requirement