Document that forking while having open libpq connections is not
authorBruce Momjian <bruce@momjian.us>
Thu, 28 May 2009 20:02:10 +0000 (20:02 +0000)
committerBruce Momjian <bruce@momjian.us>
Thu, 28 May 2009 20:02:10 +0000 (20:02 +0000)
advised.

doc/src/sgml/libpq.sgml

index 209151b5d0e9f61350b95c82653c1271f489bd70..86affb0100aea59b29a8db8212360e5b2e20b1cf 100644 (file)
    whether a connection was successfully made before queries are sent
    via the connection object.
 
+   <warning>
+    <para>
+     On Unix, forking a process with open libpq connections can lead to
+     unpredictable results because the parent and child processes share
+     the same sockets and operating system resources.  For this reason,
+     such usage is not recommended, though doing an <function>exec</> from
+     the child process to load a new executable is safe.
+    </para>
+   </warning>
+
    <note>
     <para>
      On Windows, there is a way to improve performance if a single