Re: psql \copy hanging

From: "Arnaud L(dot)" <arnaud(dot)listes(at)codata(dot)eu>
To: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: psql \copy hanging
Date: 2019-10-07 07:41:57
Message-ID: d3ea5535-5e9a-9472-3051-175b70856a19@codata.eu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Le 04/10/2019 à 19:08, Adrian Klaver a écrit :
> On 10/4/19 12:19 AM, Arnaud L. wrote:
>> OK I can do that. I thought I nailed it down to this line because it
>> started failing when this line was ~5th in the script, and it kept
>> failing on that very same line after I moved it at the very end of the
>> script (that's where it is now).
>
> Which tends to point to it as the problem. The question is whether it
> exhibits that behavior on its own or only when in combination with the
> other commands.

Yes. It ran fine this last night. I had moved the line back to its
original place, so now everything is exactly like it was before it
started showing this behaviour.

So, still apparently random...

>> As a side note, COPY (...) TO STDOUT \g 'somefile' does not work in a
>> script file (i.e. it does not work if the command is passed in a file
>> via the -f argument).
>> The command runs fine, no error is raised either by the client or the
>> server, but no file is written.
>
> Yeah not sure how that is supposed to work:
>
[...]
> production_(postgres)# \copy (select * from cell_per) TO STDOUT \g
> 'cell.txt'
> ERROR: syntax error at or near "\"
> LINE 1: COPY ( select * from cell_per ) TO STDOUT \g 'cell.txt'

This works with real SQL commands, so it should be "COPY" here, not "\copy".

Regards
--
Arnaud

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tatsuo Ishii 2019-10-07 08:00:24 RowDescription message
Previous Message Arya F 2019-10-07 06:05:19 will postgresql-12-postgis-2.5 become available in the postgres repository?