Re: psql \copy hanging

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: arnaud(dot)listes(at)codata(dot)eu, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: psql \copy hanging
Date: 2019-10-08 14:03:04
Message-ID: 5612153a-af11-38da-c34e-8b4bab9cfc8e@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 10/8/19 12:06 AM, Arnaud L. wrote:
> Le 07/10/2019 à 16:36, Adrian Klaver a écrit :
>> So you are saying that you have not run the problematic line by itself?
>
> It hung during last night's run.
>
> I had modified my batch script to run the \copy commands separately,
> i.e. it now reads as :
> psql -h myserver -a mydb < originalscriptwithoutproblematicline.sql
> psql -h myserver -a mydb < problematicline.sql

This is going to be hard to troubleshoot if you change your commands.

Previously you had:
psql -h %MYPGSERVER% -a -f myscript.sql %MYPGDB%

Changing more then one thing at a time makes it that much more difficult
to isolate the issue.

I would create an entirely separate batch file that runs just
problematicline.sql.

Given that you suspect Postgres it would be helpful to see the query
that underlies the view you are copying.

You might want to look at autoexplain:

https://www.postgresql.org/docs/11/auto-explain.html

as a way of getting information at run time.

>
> It hung at the problematic line, so during the second psql command.
>
> I'm really at loss... I *believe* that the problem lies either in psql
> or in PostgreSQL, but I really don't know what to try now.
>
>
> Regards
> --
> Arnaud
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Arnaud L. 2019-10-08 14:22:48 Re: psql \copy hanging
Previous Message Shatamjeev Dewan 2019-10-08 14:00:23 RE: Declarative Range Partitioning Postgres 11