pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Arnaud L. <arnaud.listes@codata.eu>
To: Adrian Klaver <adrian.klaver@aklaver.com>
To: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: psql \copy hanging
Date: Tue, 8 Oct 2019 16:22:48 +0200
Message-ID: <e2b59d3d-6a47-1316-f565-3d093be4644c@codata.eu> (raw)
In-Reply-To: <5612153a-af11-38da-c34e-8b4bab9cfc8e@aklaver.com>
References: <bb6d847c-e9c0-4b6d-4299-0b879042899a@codata.eu>
	<9e9164df-e7b7-bcd3-538a-7714907f7df4@aklaver.com>
	<171491de-b8e1-7f0d-0724-4d06a7902cc0@codata.eu>
	<291938b2-5816-5858-065f-e85387def0eb@aklaver.com>
	<230d9c65-450f-b97c-7ef0-c8e9a85103f6@codata.eu>
	<8f921914-178e-b520-7f93-dab80ea02555@aklaver.com>
	<d3ea5535-5e9a-9472-3051-175b70856a19@codata.eu>
	<e0288734-ad16-84aa-f6af-c7ebff2c3bac@aklaver.com>
	<ebfbdd2d-346d-f656-8b99-23c0ca50222c@codata.eu>
	<5612153a-af11-38da-c34e-8b4bab9cfc8e@aklaver.com>

Le 08/10/2019 à 16:03, Adrian Klaver a écrit :
> 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.

Yes, true. Actually I do one change at a time, I'm just no posting every 
single attempt. So I tried to feed the script using console redirection 
rather than -f as you can see. That was the only change.

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

OK, that's easy.
Actually the batch file is not doing much more than running this psql 
command, but that's really not a problem/

> 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.

OK that's nice.
Since I don't want to mess with the whole server configuration, I added 
some auto_explain settings to my script.

So for tonight, my script looks like this :

LOAD 'auto_explain';
SET auto_explain.log_min_duration = 0;
SET auto_explain.log_analyze = true;
COPY (SELECT * FROM myview) TO STDOUT \g '\\\\myserver\\myshare\\myfile.txt'

And it'll run in a separate batch.

Thanks for your help Adrian !

Regards
--
Arnaud





view thread (40+ messages)  latest in thread

Message-ID: <e2b59d3d-6a47-1316-f565-3d093be4644c@codata.eu>
Permalink:  ../e2b59d3d-6a47-1316-f565-3d093be4644c@codata.eu/
Also on:    postgresql.org/message-id/e2b59d3d-6a47-1316-f565-3d093be4644c@codata.eu

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: arnaud.listes@codata.eu, adrian.klaver@aklaver.com
  Subject: Re: psql \copy hanging
  In-Reply-To: <e2b59d3d-6a47-1316-f565-3d093be4644c@codata.eu>
  References: <bb6d847c-e9c0-4b6d-4299-0b879042899a@codata.eu> <9e9164df-e7b7-bcd3-538a-7714907f7df4@aklaver.com> <171491de-b8e1-7f0d-0724-4d06a7902cc0@codata.eu> <291938b2-5816-5858-065f-e85387def0eb@aklaver.com> <230d9c65-450f-b97c-7ef0-c8e9a85103f6@codata.eu> <8f921914-178e-b520-7f93-dab80ea02555@aklaver.com> <d3ea5535-5e9a-9472-3051-175b70856a19@codata.eu> <e0288734-ad16-84aa-f6af-c7ebff2c3bac@aklaver.com> <ebfbdd2d-346d-f656-8b99-23c0ca50222c@codata.eu> <5612153a-af11-38da-c34e-8b4bab9cfc8e@aklaver.com> <e2b59d3d-6a47-1316-f565-3d093be4644c@codata.eu>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox