@@ -9236,14 +9236,28 @@ void PQinitSSL(int do_ssl);
9236
9236
</indexterm>
9237
9237
9238
9238
<para>
9239
- <application>libpq</application> is reentrant and thread-safe by default.
9240
- You might need to use special compiler command-line
9241
- options when you compile your application code. Refer to your
9242
- system's documentation for information about how to build
9243
- thread-enabled applications, or look in
9244
- <filename>src/Makefile.global</filename> for <literal>PTHREAD_CFLAGS</literal>
9245
- and <literal>PTHREAD_LIBS</literal>. This function allows the querying of
9246
- <application>libpq</application>'s thread-safe status:
9239
+ As of version 17, <application>libpq</application> is always reentrant and thread-safe.
9240
+ However, one restriction is that no two threads attempt to manipulate
9241
+ the same <structname>PGconn</structname> object at the same time. In particular,
9242
+ you cannot issue concurrent commands from different threads through
9243
+ the same connection object. (If you need to run concurrent commands,
9244
+ use multiple connections.)
9245
+ </para>
9246
+
9247
+ <para>
9248
+ <structname>PGresult</structname> objects are normally read-only after creation,
9249
+ and so can be passed around freely between threads. However, if you use
9250
+ any of the <structname>PGresult</structname>-modifying functions described in
9251
+ <xref linkend="libpq-misc"/> or <xref linkend="libpq-events"/>, it's up
9252
+ to you to avoid concurrent operations on the same <structname>PGresult</structname>,
9253
+ too.
9254
+ </para>
9255
+
9256
+ <para>
9257
+ In earlier versions, <application>libpq</application> could be compiled
9258
+ with or without thread support, depending on compiler options. This
9259
+ function allows the querying of <application>libpq</application>'s
9260
+ thread-safe status:
9247
9261
</para>
9248
9262
9249
9263
<variablelist>
@@ -9261,29 +9275,12 @@ int PQisthreadsafe();
9261
9275
9262
9276
<para>
9263
9277
Returns 1 if the <application>libpq</application> is thread-safe
9264
- and 0 if it is not.
9278
+ and 0 if it is not. Always returns 1 on version 17 and above.
9265
9279
</para>
9266
9280
</listitem>
9267
9281
</varlistentry>
9268
9282
</variablelist>
9269
9283
9270
- <para>
9271
- One thread restriction is that no two threads attempt to manipulate
9272
- the same <structname>PGconn</structname> object at the same time. In particular,
9273
- you cannot issue concurrent commands from different threads through
9274
- the same connection object. (If you need to run concurrent commands,
9275
- use multiple connections.)
9276
- </para>
9277
-
9278
- <para>
9279
- <structname>PGresult</structname> objects are normally read-only after creation,
9280
- and so can be passed around freely between threads. However, if you use
9281
- any of the <structname>PGresult</structname>-modifying functions described in
9282
- <xref linkend="libpq-misc"/> or <xref linkend="libpq-events"/>, it's up
9283
- to you to avoid concurrent operations on the same <structname>PGresult</structname>,
9284
- too.
9285
- </para>
9286
-
9287
9284
<para>
9288
9285
The deprecated functions <xref linkend="libpq-PQrequestCancel"/> and
9289
9286
<xref linkend="libpq-PQoidStatus"/> are not thread-safe and should not be
0 commit comments