Re: Permission denied in file_fdw (Windows)

Поиск
Список
Период
Сортировка
От Tomas Vondra
Тема Re: Permission denied in file_fdw (Windows)
Дата
Msg-id 50BE8D9A.9080307@fuzzy.cz
обсуждение исходный текст
Ответ на Permission denied in file_fdw (Windows)  (Stefan Keller <sfkeller@gmail.com>)
Ответы Re: Permission denied in file_fdw (Windows)
Список pgsql-general
Hi,

On 5.12.2012 00:39, Stefan Keller wrote:
> Hi
>
> I'm getting an error when reading from a file_fdw table in a Windows
> environment.
> Any hints? (see below).

Well, the file clearly isn't accessible by the postgres user (or
whatever user you're using in Windows). The file is opened from a
PostgreSQL backend process, not using your regular user.

> And http://www.postgresql.org/docs/9.1/static/file-fdw.html is not
> really verbose :->
> At least following format options should be mentioned: 'xml', 'text',
> 'csv', 'binary'.

It clearly states that "format" accepts the same values as COPY and even
provides a link to COPY documentation. Placing this kind of details onto
both pages would be just maintenance burden.

> Yours, Stefan
>
>
> That's what I'm doing:
>
> CREATE EXTENSION file_fdw;
>
> CREATE SERVER file_server FOREIGN DATA WRAPPER file_fdw;
>
> CREATE FOREIGN TABLE foreignfiletable(id text, title text)
> SERVER file_server
> OPTIONS(format 'csv', header 'true', filename
> 'C:/Users/someuser/Downloads/file.csv', delimiter '|', null '');
>
> SELECT * FROM foreignfiletable;
> -- ERROR:  file »C:/Users/someuser/Downloads/file.csv« could not be
> opened for reading: Permission denied.

What else could PostgreSQL tell you? It tried to open the file, did a
regular open() or something like that and it failed with EACCES error
code. That's all the info there is.

Tomas



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

Предыдущее
От: Raymond O'Donnell
Дата:
Сообщение: Re: Permission denied in file_fdw (Windows)
Следующее
От: Kenneth Tilton
Дата:
Сообщение: How get column-wise table info from an arbitrary query?