Re: [PATCH] COPY vs \copy HINT - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [PATCH] COPY vs \copy HINT
Date
Msg-id 6179.1472761708@sss.pgh.pa.us
Whole thread Raw
In response to Re: [PATCH] COPY vs \copy HINT  (Craig Ringer <craig@2ndquadrant.com>)
Responses Re: [PATCH] COPY vs \copy HINT
List pgsql-hackers
Craig Ringer <craig@2ndquadrant.com> writes:
> On 12 August 2016 at 16:34, Christoph Berg <myon@debian.org> 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 suggestion now, but I think it
>> needs rephrasing.

> I don't like it either, but didn't come up with anything better. The
> problem is that every driver calls it something different.

A few thoughts on this patch:

1. I don't really think the HINT is appropriate for the not-absolute-path
case.

2. I don't think it's appropriate for all possible cases of AllocateFile
failure either, eg surely not for EACCES or similar situations where we
did find a file.  Maybe print it only for ENOENT?  (See for example
report_newlocale_failure() for technique.)

3. As for the wording, maybe you could do it like this:

HINT:  COPY copies to[from] a file on the PostgreSQL server, not on the
client.  You may want a client-side facility such as psql's \copy.

That avoids trying to invent a name for other implementations.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: LOCK TABLE .. DEFERRABLE
Next
From: Tomas Vondra
Date:
Subject: Re: incomplete removal of not referenced CTEs