Gilles Darold wrote:
> postgres=# \setfileref b /dev/random
> postgres=# insert into test (:b);
>
> Process need to be killed using SIGTERM.
This can be fixed by setting sigint_interrupt_enabled to true
before operating on the file. Then ctrl-C would be able to cancel
the command.
See comment in common.c, above the declaration of
sigint_interrupt_enabled:
/*[....]* SIGINT is supposed to abort all long-running psql operations, not only* database queries. In most places,
thisis accomplished by checking* cancel_pressed during long-running loops. However, that won't work when* blocked on
userinput (in readline() or fgets()). In those places, we* set sigint_interrupt_enabled TRUE while blocked,
instructingthe signal* catcher to longjmp through sigint_interrupt_jmp. We assume readline and* fgets are coded to
handlepossible interruption. (XXX currently this does* not work on win32, so control-C is less useful there)*/
Best regards,
--
Daniel Vérité
PostgreSQL-powered mailer: http://www.manitou-mail.org
Twitter: @DanielVerite