postgresql/src/interfaces/libpq
Tom Lane a584d03ced Avoid concurrent calls to bindtextdomain().
We previously supposed that it was okay for different threads to
call bindtextdomain() concurrently (cf. commit 1f655fdc3).
It now emerges that there's at least one gettext implementation
in which that triggers an abort() crash, so let's stop doing that.
Add mutexes guarding libpq's and ecpglib's calls, which are the
only ones that need worry about multithreaded callers.

Note: in libpq, we could perhaps have piggybacked on
default_threadlock() to avoid defining a new mutex variable.
I judge that not terribly safe though, since libpq_gettext could
be called from code that is holding the default mutex.  If that
were the first such call in the process, it'd fail.  An extra
mutex is cheap insurance against unforeseen interactions.

Per bug #18312 from Christian Maurer.  Back-patch to all
supported versions.

Discussion: https://postgr.es/m/18312-bbbabc8113592b78@postgresql.org
Discussion: https://postgr.es/m/264860.1707163416@sss.pgh.pa.us
2024-02-09 11:21:08 -05:00
..
po Update copyright for 2024 2024-01-03 20:49:05 -05:00
t Update copyright for 2024 2024-01-03 20:49:05 -05:00
test Update copyright for 2024 2024-01-03 20:49:05 -05:00
.gitignore Run tap tests in src/interfaces/libpq. 2022-02-26 16:51:47 -08:00
Makefile Exclude Threadsanitizer instrumentation in exit check 2024-01-31 22:54:45 +01:00
README Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
exports.txt libpq: Add PQsendPipelineSync() 2024-01-16 10:13:42 +09:00
fe-auth-sasl.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
fe-auth-scram.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
fe-auth.c Add new function, PQchangePassword(), to libpq 2024-01-09 09:16:48 -05:00
fe-auth.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
fe-cancel.c libpq: Move cancellation related functions to fe-cancel.c 2024-01-29 12:39:59 +01:00
fe-connect.c Clean up Windows-specific mutex code in libpq and ecpglib. 2024-02-09 11:11:39 -05:00
fe-exec.c Remove some comments related to pqPipelineSync() and PQsendPipelineSync() 2024-01-17 15:53:59 +09:00
fe-gssapi-common.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
fe-gssapi-common.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
fe-lobj.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
fe-misc.c Avoid concurrent calls to bindtextdomain(). 2024-02-09 11:21:08 -05:00
fe-print.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
fe-protocol3.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
fe-secure-common.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
fe-secure-common.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
fe-secure-gssapi.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
fe-secure-openssl.c Clean up Windows-specific mutex code in libpq and ecpglib. 2024-02-09 11:11:39 -05:00
fe-secure.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
fe-trace.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
legacy-pqsignal.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
libpq-events.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
libpq-events.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
libpq-fe.h libpq: Add PQsendPipelineSync() 2024-01-16 10:13:42 +09:00
libpq-int.h libpq: Change some static functions to extern 2024-02-04 16:35:16 +01:00
meson.build libpq: Move cancellation related functions to fe-cancel.c 2024-01-29 12:39:59 +01:00
nls.mk Rename port/thread.c to port/user.c. 2023-07-09 18:17:09 +12:00
pg_service.conf.sample Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
pqexpbuffer.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
pqexpbuffer.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
pthread-win32.c Clean up Windows-specific mutex code in libpq and ecpglib. 2024-02-09 11:11:39 -05:00
win32.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
win32.h Recognize network-failure errnos as indicating hard connection loss. 2020-10-10 13:28:12 -04:00

README

src/interfaces/libpq/README

This directory contains the C version of Libpq, the POSTGRES frontend library.