diff --git a/functions/pgsql.xml b/functions/pgsql.xml
index f172993bae..ace209db76 100644
--- a/functions/pgsql.xml
+++ b/functions/pgsql.xml
@@ -1027,6 +1027,50 @@ echo $row[1] . " <- row\n";
+
+
+ pg_trace
+ Trace a connection to PostgreSQL server
+
+
+ Description
+
+ bool pg_trace
+ string
+ filename
+
+ string
+ mode
+
+ int
+ connection
+
+
+
+ Enables tracing of the PostgreSQL frontend/backend communication
+ to a debugging file. To fully understand the results one needs to be
+ familiar with the internals of PostgreSQL communication protocol.
+ For those who are not, it can still be useful for tracing errors in
+ queries sent to the server, you could do for example
+ 'grep '^To backend' trace.log' and see what queriew actually were sent
+ to the PostgreSQL server.
+
+
+ filename and mode are the
+ same as in fopen (mode defaults
+ to 'w'), connection specifies the connection to
+ trace and defaults to the last one opened.
+
+
+ Returns TRUE if filename could be opened for
+ logging, FALSE otherwise.
+
+
+ See also fopen and pg_untrace.
+
+
+
+
pg_tty
@@ -1046,6 +1090,33 @@ echo $row[1] . " <- row\n";
+
+
+ pg_untrace
+ Stop tracing a connection to PostgreSQL server
+
+
+ Description
+
+ bool pg_untrace
+ int
+ connection
+
+
+
+ Stop tracing started by pg_trace.
+ connection specifies the connection that was
+ traced and defaults to the last one opened.
+
+
+ Returns always TRUE.
+
+
+ See also pg_trace.
+
+
+
+