postgresql/src/include
Tom Lane 8eb4a9312c Avoid thread-safety problem in ecpglib.
ecpglib attempts to force the LC_NUMERIC locale to "C" while reading
server output, to avoid problems with strtod() and related functions.
Historically it's just issued setlocale() calls to do that, but that
has major problems if we're in a threaded application.  setlocale()
itself is not required by POSIX to be thread-safe (and indeed is not,
on recent OpenBSD).  Moreover, its effects are process-wide, so that
we could cause unexpected results in other threads, or another thread
could change our setting.

On platforms having uselocale(), which is required by POSIX:2008,
we can avoid these problems by using uselocale() instead.  Windows
goes its own way as usual, but we can make it safe by using
_configthreadlocale().  Platforms having neither continue to use the
old code, but that should be pretty much nobody among current systems.

This should get back-patched, but let's see what the buildfarm
thinks of it first.

Michael Meskes and Tom Lane; thanks also to Takayuki Tsunakawa.

Discussion: https://postgr.es/m/31420.1547783697@sss.pgh.pa.us
2019-01-21 12:07:02 -05:00
..
access Restrict the use of temporary namespace in two-phase transactions 2019-01-18 09:21:44 +09:00
bootstrap Update copyright for 2019 2019-01-02 12:44:25 -05:00
catalog Move CloneForeignKeyConstraints to tablecmds.c 2019-01-18 15:00:06 -03:00
commands Move vacuumlazy.c into access/heap. 2019-01-15 12:06:19 -08:00
common Use perfect hashing, instead of binary search, for keyword lookup. 2019-01-09 19:47:46 -05:00
datatype Update copyright for 2019 2019-01-02 12:44:25 -05:00
executor Don't include genam.h from execnodes.h and relscan.h anymore. 2019-01-14 17:02:12 -08:00
fe_utils pgbench: add \cset and \gset commands 2019-01-10 13:42:20 -03:00
foreign Update copyright for 2019 2019-01-02 12:44:25 -05:00
jit Make naming of tupdesc related structs more consistent with the rest of PG. 2019-01-14 16:25:50 -08:00
lib Update copyright for 2019 2019-01-02 12:44:25 -05:00
libpq Update copyright for 2019 2019-01-02 12:44:25 -05:00
mb Update copyright for 2019 2019-01-02 12:44:25 -05:00
nodes Allow COPY FROM to filter data using WHERE conditions 2019-01-20 00:22:14 +01:00
optimizer Reorganize planner code moved in b60c397599 2019-01-16 16:27:44 -03:00
parser Allow COPY FROM to filter data using WHERE conditions 2019-01-20 00:22:14 +01:00
partitioning Update copyright for 2019 2019-01-02 12:44:25 -05:00
port Update copyright for 2019 2019-01-02 12:44:25 -05:00
portability Update copyright for 2019 2019-01-02 12:44:25 -05:00
postmaster Update copyright for 2019 2019-01-02 12:44:25 -05:00
regex Update copyright for 2019 2019-01-02 12:44:25 -05:00
replication Update copyright for 2019 2019-01-02 12:44:25 -05:00
rewrite Update copyright for 2019 2019-01-02 12:44:25 -05:00
snowball Update copyright for 2019 2019-01-02 12:44:25 -05:00
statistics Update copyright for 2019 2019-01-02 12:44:25 -05:00
storage Replace @postgresql.org with @lists.postgresql.org for mailinglists 2019-01-19 19:06:35 +01:00
tcop Update copyright for 2019 2019-01-02 12:44:25 -05:00
tsearch Update copyright for 2019 2019-01-02 12:44:25 -05:00
utils Finish reverting "recheck_on_update" patch. 2019-01-15 12:07:10 -05:00
.gitignore Refactor dlopen() support 2018-09-06 11:33:04 +02:00
c.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
fmgr.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
funcapi.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
getaddrinfo.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
getopt_long.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
Makefile Refactor dlopen() support 2018-09-06 11:33:04 +02:00
miscadmin.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
pg_config.h.in Avoid thread-safety problem in ecpglib. 2019-01-21 12:07:02 -05:00
pg_config.h.win32 Avoid thread-safety problem in ecpglib. 2019-01-21 12:07:02 -05: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 Update copyright for 2019 2019-01-02 12:44:25 -05:00
pg_getopt.h Use our own getopt() on OpenBSD. 2019-01-18 15:06:26 -05:00
pg_trace.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
pgstat.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
pgtar.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
pgtime.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
port.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
postgres.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
postgres_ext.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
postgres_fe.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
rusagestub.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
windowapi.h Update copyright for 2019 2019-01-02 12:44:25 -05:00