Re: Can't terminate hung COPY

From: Martín Marqués <martin(dot)marques(at)gmail(dot)com>
To: David Rees <drees76(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Can't terminate hung COPY
Date: 2013-03-20 20:12:44
Message-ID: CABeG9Lvg7A-ykk2UnjNsWEz-Q9-T6SAjSSbZXQUJ+cbbR3A3Tg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

2013/3/20 David Rees <drees76(at)gmail(dot)com>:
> PostgreSQL 8.4.16 on CentOS 5.9.
>
> I've run into a situation where executing a \COPY from psql will hang
> and at that point it's impossible to terminate the COPY command.
>
> I've tried pg_cancel_backend and pg_terminalte_backend - even sending
> the process itself a TERM signal.
>
> Sending the process KILL works, but of course that restarts the entire
> server which is far from ideal.
>
> Any idea on how to cleanly terminal the offending process at this point?
>
> Any idea on what may cause \COPY to hang and how to prevent it?

What happens if you use COPY ... FROM with the same data?

Are you sure the process hangs (strange thing is that you can't
terminate the backend)? Could it be that it looks like it hung, but
it's actually COPYing a huge chunk of data?

--
Martín Marqués
select 'martin.marques' || '@' || 'gmail.com'
DBA, Programador, Administrador

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2013-03-20 20:12:49 Re: State of the art re: group default privileges
Previous Message Michael Orlitzky 2013-03-20 20:04:05 State of the art re: group default privileges