Re: psql \copy hanging

Поиск
Список
Период
Сортировка
От Adrian Klaver
Тема Re: psql \copy hanging
Дата
Msg-id f9cb2bae-9f54-df3d-900d-82371d6fb62c@aklaver.com
обсуждение исходный текст
Ответ на psql \copy hanging  ("Arnaud L." <arnaud.listes@codata.eu>)
Ответы Re: psql \copy hanging  ("Arnaud L." <arnaud.listes@codata.eu>)
Список pgsql-general
On 8/22/19 1:47 AM, Arnaud L. wrote:
> 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.
> 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 ?

The first thing I think of when seeing this sort of behavior on Windows 
is anti-virus software. Doing you have any running on the machine?

You say it always hangs on the same line. Is that line doing something 
different from the others? Say writing to a different location.




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


-- 
Adrian Klaver
adrian.klaver@aklaver.com



В списке pgsql-general по дате отправления:

Предыдущее
От: Reid Thompson
Дата:
Сообщение: Re: Importing from CSV, auto creating table?
Следующее
От: "Arnaud L."
Дата:
Сообщение: Re: psql \copy hanging