Re: [HACKERS] [PATCH] COPY vs \copy HINT

2016-09-06 Thread Tom Lane
Craig Ringer writes: > On 7 September 2016 at 04:19, Christoph Berg wrote: >> I like your new version, it's crisp and transports the right message. > OK, updated with Tom's tweaked version of Christoph's wording per > discussion. Thanks all. Pushed with

Re: [HACKERS] [PATCH] COPY vs \copy HINT

2016-09-06 Thread Craig Ringer
On 7 September 2016 at 04:19, Christoph Berg wrote: > I like your new version, it's crisp and transports the right message. OK, updated with Tom's tweaked version of Christoph's wording per discussion. Thanks all. -- Craig Ringer http://www.2ndQuadrant.com/

Re: [HACKERS] [PATCH] COPY vs \copy HINT

2016-09-06 Thread Christoph Berg
Re: Tom Lane 2016-09-06 <17637.1473192...@sss.pgh.pa.us> > Christoph's idea isn't bad. We could tweak it to: > > COPY TO instructs the PostgreSQL server process to write a file. > > COPY FROM instructs the PostgreSQL server process to read a file. > > This seems to cover both the

Re: [HACKERS] [PATCH] COPY vs \copy HINT

2016-09-06 Thread Tom Lane
Craig Ringer writes: > Tom, any preference here? > I'm probably inclined to go for your original wording and accept that > it's just too hard to hint at the client/server process split in a > single short message. I think my original wording is pretty hopeless for the

Re: [HACKERS] [PATCH] COPY vs \copy HINT

2016-09-05 Thread Craig Ringer
On 5 September 2016 at 16:32, Christoph Berg wrote: > The part about the server permissions might be useful to hint at. > What about > > "COPY TO instructs the PostgreSQL server to write to a file on the > server. " > "You may want a client-side facility such as

Re: [HACKERS] [PATCH] COPY vs \copy HINT

2016-09-05 Thread Christoph Berg
Re: Craig Ringer 2016-09-05 > To cover the same-host case we could try something like: > >COPY runs on the PostgreSQL server, using the PostgreSQL server's > directories and permissions, it doesn't run on the client. > >

Re: [HACKERS] [PATCH] COPY vs \copy HINT

2016-09-04 Thread Craig Ringer
On 5 September 2016 at 09:05, Craig Ringer wrote: >I've attached an update that does so and > warns on EACCES too. ... this time, with required parens. -- Craig Ringer http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training &

Re: [HACKERS] [PATCH] COPY vs \copy HINT

2016-09-04 Thread Craig Ringer
On 4 September 2016 at 23:33, Tom Lane wrote: > 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

Re: [HACKERS] [PATCH] COPY vs \copy HINT

2016-09-04 Thread Tom Lane
I wrote: > Craig Ringer 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:

Re: [HACKERS] [PATCH] COPY vs \copy HINT

2016-09-02 Thread Tom Lane
Craig Ringer writes: > On 2 September 2016 at 04:28, Tom Lane wrote: >> 1. I don't really think the HINT is appropriate for the not-absolute-path >> case. > Why? If the user runs > # COPY sometable FROM 'localfile.csv' WITH (FORMAT CSV); > ERROR:

Re: [HACKERS] [PATCH] COPY vs \copy HINT

2016-09-02 Thread Craig Ringer
On 2 September 2016 at 17:05, Christoph Berg wrote: > Re: Craig Ringer 2016-09-02 > >> I thought about that but figured it didn't really matter too much, >> when thinking about examples like >> >> # COPY

Re: [HACKERS] [PATCH] COPY vs \copy HINT

2016-09-02 Thread Christoph Berg
Re: Craig Ringer 2016-09-02 > 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

Re: [HACKERS] [PATCH] COPY vs \copy HINT

2016-09-01 Thread Craig Ringer
On 2 September 2016 at 04:28, Tom Lane wrote: > Craig Ringer writes: >> On 12 August 2016 at 16:34, Christoph Berg wrote: >>> Also, I vaguely get what you wanted to say with "a driver ... >>> wrapper", but it's pretty nonsensical if

Re: [HACKERS] [PATCH] COPY vs \copy HINT

2016-09-01 Thread Tom Lane
Craig Ringer writes: > On 12 August 2016 at 16:34, Christoph Berg wrote: >> Also, I vaguely get what you wanted to say with "a driver ... >> wrapper", but it's pretty nonsensical if one doesn't know about the >> protocol details. I don't have a better

Re: [HACKERS] [PATCH] COPY vs \copy HINT

2016-08-12 Thread Craig Ringer
On 12 August 2016 at 16:34, Christoph Berg wrote: > > postgres=# COPY x TO '/root/nopermissions'; > > ERROR: could not open file "/root/nopermissions" for writing: Permission > > denied > > HINT: Paths for COPY are on the PostgreSQL server, not the client. You > may > > want

Re: [HACKERS] [PATCH] COPY vs \copy HINT

2016-08-12 Thread Christoph Berg
Re: Craig Ringer 2016-08-12 > I think we should emit a HINT here, something like: > > ERROR: could not open file "D:\CBS_woningcijfers_2014.csv" for reading: No > such file or directory' > HINT: Paths for COPY are on the

[HACKERS] [PATCH] COPY vs \copy HINT

2016-08-12 Thread Craig Ringer
Hi all I see this sort of question quite a bit: http://stackoverflow.com/q/38903811/398670 where the user wonders why COPY gemeenten FROM 'D:\CBS_woningcijfers_2014.csv' DELIMITER ';' CSV fails with ERROR: could not open file "D:\CBS_woningcijfers_2014.csv" for reading: No such file or