Re: [PATCH] COPY vs \copy HINT

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [PATCH] COPY vs \copy HINT
Дата
Msg-id 5985.1473003235@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [PATCH] COPY vs \copy HINT  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: [PATCH] COPY vs \copy HINT  (Craig Ringer <craig@2ndquadrant.com>)
Список pgsql-hackers
I wrote:
> Craig Ringer <craig@2ndquadrant.com> writes:
>> I thought about that but figured it didn't really matter too much,
>> when thinking about examples like
>> # COPY batch_demo FROM '/root/secret.csv' WITH (FORMAT CSV);
>> ERROR:  could not open file "/root/secret.csv" for reading: Permission denied
>> or whatever, where the user doesn't understand why they can't read the
>> file given that their local client has permission to do so.

> Meh.  Hinting in this case could be helpful only if the user in fact had
> identical directory structures on client and server and a data file in the
> right place on both.

So my consciousness was raised just now by an example of exactly this
scenario over in pgsql-novice.  What I forgot was that the client may
in fact be on the same machine as the server, in which case EACCES
is pretty much exactly what you'd expect.  So we probably do want to
hint for that case, but the hint wording I previously suggested no
longer seems like le mot juste ... it needs to cover the idea that
the client and server are different processes on the same machine.

I don't suppose there's any easy way for COPY to distinguish local
from remote connections --- if it could, that might influence both
the errnos to hint for and the phrasing of the hint.
        regards, tom lane



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

Предыдущее
От: Stephen Frost
Дата:
Сообщение: Re: Add support for restrictive RLS policies
Следующее
От: Stephen Frost
Дата:
Сообщение: Re: Remove superuser() checks from pgstattuple