mirror of
https://github.com/postgres/postgres.git
synced 2025-07-09 22:41:56 +03:00
Clean up psql's control-C handling to avoid longjmp'ing out of random
places --- that risks corrupting data structures, losing sync with the backend, etc. We now longjmp only from calls to readline, fgets, and fread, which we assume are coded to protect themselves against interrupts at undesirable times. This requires adding explicit tests for cancel_pressed in long-running loops, but on the whole it's far cleaner. Martijn van Oosterhout and Tom Lane.
This commit is contained in:
@ -3,7 +3,7 @@
|
||||
*
|
||||
* Copyright (c) 2000-2006, PostgreSQL Global Development Group
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.139 2006/06/01 00:15:36 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.140 2006/06/14 16:49:02 tgl Exp $
|
||||
*/
|
||||
#include "postgres_fe.h"
|
||||
#include "describe.h"
|
||||
@ -663,6 +663,11 @@ describeTableDetails(const char *pattern, bool verbose)
|
||||
PQclear(res);
|
||||
return false;
|
||||
}
|
||||
if (cancel_pressed)
|
||||
{
|
||||
PQclear(res);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
PQclear(res);
|
||||
|
Reference in New Issue
Block a user