After editing query with external editor psql exits on Ctrl-C:
% psql postgres
SET
Timing is on.
psql (9.2beta1)
Type "help" for help.
postgres=# --- Ctrl-C
postgres=# --- Ctrl-C
postgres=# --- Ctrl-C
postgres=# \e
...
postgres=# --- Ctrl-C
%
Some details:
external editor - nvi/vim, OS FreeBSD 9.0 64-bit,
% ldd /usr/local/pgsql/bin/psql
/usr/local/pgsql/bin/psql: libpq.so.5 => /usr/local/pgsql/lib/libpq.so.5 (0x8008b4000) libreadline.so.8
=>/lib/libreadline.so.8 (0x800ae5000) libc.so.7 => /lib/libc.so.7 (0x800d24000) libthr.so.3 =>
/lib/libthr.so.3(0x80106a000) libncurses.so.8 => /lib/libncurses.so.8 (0x80128d000)
--
Teodor Sigaev E-mail: teodor@sigaev.ru
WWW: http://www.sigaev.ru/