postgresql/src/include
Tom Lane 2ec477dc81 Cope with Readline's failure to track SIGWINCH events outside of input.
It emerges that libreadline doesn't notice terminal window size change
events unless they occur while collecting input.  This is easy to stumble
over if you resize the window while using a pager to look at query output,
but it can be demonstrated without any pager involvement.  The symptom is
that queries exceeding one line are misdisplayed during subsequent input
cycles, because libreadline has the wrong idea of the screen dimensions.

The safest, simplest way to fix this is to call rl_reset_screen_size()
just before calling readline().  That causes an extra ioctl(TIOCGWINSZ)
for every command; but since it only happens when reading from a tty, the
performance impact should be negligible.  A more valid objection is that
this still leaves a tiny window during entry to readline() wherein delivery
of SIGWINCH will be missed; but the practical consequences of that are
probably negligible.  In any case, there doesn't seem to be any good way to
avoid the race, since readline exposes no functions that seem safe to call
from a generic signal handler --- rl_reset_screen_size() certainly isn't.

It turns out that we also need an explicit rl_initialize() call, else
rl_reset_screen_size() dumps core when called before the first readline()
call.

rl_reset_screen_size() is not present in old versions of libreadline,
so we need a configure test for that.  (rl_initialize() is present at
least back to readline 4.0, so we won't bother with a test for it.)
We would need a configure test anyway since libedit's emulation of
libreadline doesn't currently include such a function.  Fortunately,
libedit seems not to have any corresponding bug.

Merlin Moncure, adjusted a bit by me
2015-12-16 16:59:35 -05:00
..
access Fix commit timestamp initialization 2015-12-11 14:30:43 -03:00
bootstrap pgindent run for 9.5 2015-05-23 21:35:49 -04:00
catalog Fix handling of inherited check constraints in ALTER COLUMN TYPE (again). 2015-11-20 14:55:47 -05:00
commands Handle policies during DROP OWNED BY 2015-12-11 16:12:25 -05:00
common pgindent run for 9.5 2015-05-23 21:35:49 -04:00
datatype Define integer limits independently from the system definitions. 2015-04-02 17:43:35 +02:00
executor Allow EXPLAIN (ANALYZE, VERBOSE) to display per-worker statistics. 2015-12-09 13:21:19 -05:00
foreign Allow foreign and custom joins to handle EvalPlanQual rechecks. 2015-12-08 12:31:03 -05:00
lib Avoid use of float arithmetic in bipartite_match.c. 2015-08-23 13:02:18 -04:00
libpq Don't send protocol messages to a shm_mq that no longer exists. 2015-10-16 09:42:33 -04:00
mb Avoid doing encoding conversions by double-conversion via MULE_INTERNAL. 2015-11-28 13:42:27 -05:00
nodes Get rid of the planner's LateralJoinInfo data structure. 2015-12-11 15:52:38 -05:00
optimizer Still more fixes for planner's handling of LATERAL references. 2015-12-11 14:22:20 -05:00
parser Determine whether it's safe to attempt a parallel plan for a query. 2015-09-16 15:38:47 -04:00
port Make abbreviated key comparisons for text a bit cheaper. 2015-10-09 15:06:06 -04:00
portability Use mmap MAP_NOSYNC option to limit shared memory writes 2015-03-21 22:06:19 -04:00
postmaster Pass extra data to bgworkers, and use this to fix parallel contexts. 2015-11-05 12:13:56 -05:00
regex Implement lookbehind constraints in our regular-expression engine. 2015-10-30 19:14:19 -04:00
replication Fix "sesssion" typo 2015-09-28 19:13:42 -03:00
rewrite RLS refactoring 2015-09-15 15:49:31 -04:00
snowball Update copyright for 2015 2015-01-06 11:43:47 -05:00
storage Move buffer I/O and content LWLocks out of the main tranche. 2015-12-15 13:32:54 -05:00
tcop Glue layer to connect the executor to the shm_mq mechanism. 2015-09-18 21:56:58 -04:00
tsearch Fix statically allocated struct with FLEXIBLE_ARRAY_MEMBER member. 2015-02-20 17:50:18 -05:00
utils Avoid caching expression state trees for domain constraints across queries. 2015-11-29 18:18:42 -05:00
.gitignore Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
Makefile Install lwlocknames.h even in vpath builds. 2015-09-11 16:45:41 -04:00
c.h Remove support for Unix systems without the POSIX signal APIs. 2015-08-31 12:56:10 -04:00
fmgr.h Fix comment in fmgr.h to refer to actual function used. 2015-06-15 23:21:03 -04:00
funcapi.h pgindent run for 9.5 2015-05-23 21:35:49 -04:00
getaddrinfo.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
getopt_long.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
miscadmin.h Perform an immediate shutdown if the postmaster.pid file is removed. 2015-10-06 17:15:52 -04:00
pg_config.h.in Cope with Readline's failure to track SIGWINCH events outside of input. 2015-12-16 16:59:35 -05:00
pg_config.h.win32 Add BSWAP64 macro. 2015-10-08 13:01:36 -04:00
pg_config_ext.h.in Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
pg_config_ext.h.win32 Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
pg_config_manual.h Define integer limits independently from the system definitions. 2015-04-02 17:43:35 +02:00
pg_getopt.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
pg_trace.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
pgstat.h pgindent run for 9.5 2015-05-23 21:35:49 -04:00
pgtar.h Adopt the GNU convention for handling tar-archive members exceeding 8GB. 2015-11-21 20:21:31 -05:00
pgtime.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
port.h Redesign tablesample method API, and do extensive code review. 2015-07-25 14:39:00 -04:00
postgres.h Support "expanded" objects, particularly arrays, for better performance. 2015-05-14 12:08:49 -04:00
postgres_ext.h pgindent run for 9.4 2014-05-06 12:12:18 -04:00
postgres_fe.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
rusagestub.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
windowapi.h Update copyright for 2015 2015-01-06 11:43:47 -05:00