pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jerry Sievers <gsievers19@comcast.net>
To: Arnaud L. <arnaud.listes@codata.eu>
Cc: pgsql-general@postgresql.org
Subject: Re: psql \copy hanging
Date: Thu, 22 Aug 2019 13:00:38 -0500
Message-ID: <87ef1dkrll.fsf@jsievers.enova.com> (raw)
In-Reply-To: <d5df5507-7491-5877-5412-c9325d0ec49c@codata.eu>
References: <d5df5507-7491-5877-5412-c9325d0ec49c@codata.eu>

"Arnaud L." <arnaud.listes@codata.eu> writes:

> Hi list
>
> On Windows, I have an unattended script that exports data overnight by
> issuing psql commands like :
> psql -f mycommands.sql
> whith mycommands.sql containing a bunch of \copy lines like :
> \copy (SELECT * FROM someview) TO
> '\\windowsserver\windowsshare\somefile.csv'
>
> When I run this script by hand, everything is fine but when it runs
> overnight it hangs and allways on the same line.

Is the overnight run being done as the same DB user you are testing
with?

If not, then perhaps the automated user deviates in resource settings
and/or permissions, in turn resulting in sluggish performance caused by
thrashing and/or inferior query plan.

> There is no lock in the database, and the connection is marked as
> active in the backend and running the statement "COPY (SELECT * FROM
> myview) TO STDOUT".
> So where can things be hanging ?
> My first guess (appart from db lock) was that the target file was
> locked by the filesystem. But wouldn't psql know about it and fail
> with an error ?
>
> Thanks for your help !
>
> --
> Arnaud
>
>
>

-- 
Jerry Sievers
Postgres DBA/Development Consulting
e: postgres.consulting@comcast.net





view thread (40+ messages)  latest in thread

Message-ID: <87ef1dkrll.fsf@jsievers.enova.com>
Permalink:  ../87ef1dkrll.fsf@jsievers.enova.com/
Also on:    postgresql.org/message-id/87ef1dkrll.fsf@jsievers.enova.com

 · 

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: gsievers19@comcast.net, arnaud.listes@codata.eu
  Subject: Re: psql \copy hanging
  In-Reply-To: <87ef1dkrll.fsf@jsievers.enova.com>
  References: <d5df5507-7491-5877-5412-c9325d0ec49c@codata.eu> <87ef1dkrll.fsf@jsievers.enova.com>

* 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