From f30ce366b6ca44a687de9247b00e75c8d6d4bc82 Mon Sep 17 00:00:00 2001 From: Christopher Kings-Lynne Date: Fri, 15 Apr 2005 08:40:12 +0000 Subject: [PATCH] - Overhaul another bunch of pgsql extension manual pages git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@184384 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/pgsql/functions/pg-close.xml | 4 +- reference/pgsql/functions/pg-dbname.xml | 34 ++++++++- reference/pgsql/functions/pg-host.xml | 54 ++++++++++++- reference/pgsql/functions/pg-options.xml | 57 +++++++++++++- reference/pgsql/functions/pg-ping.xml | 35 +++++++-- reference/pgsql/functions/pg-port.xml | 55 +++++++++++++- reference/pgsql/functions/pg-trace.xml | 97 +++++++++++++++++++----- reference/pgsql/functions/pg-tty.xml | 65 +++++++++++++++- reference/pgsql/functions/pg-untrace.xml | 59 ++++++++++++-- 9 files changed, 414 insertions(+), 46 deletions(-) diff --git a/reference/pgsql/functions/pg-close.xml b/reference/pgsql/functions/pg-close.xml index ad651f4d3a..06bda058d1 100644 --- a/reference/pgsql/functions/pg-close.xml +++ b/reference/pgsql/functions/pg-close.xml @@ -1,5 +1,5 @@ - + @@ -31,7 +31,7 @@ - + &reftitle.parameters; diff --git a/reference/pgsql/functions/pg-dbname.xml b/reference/pgsql/functions/pg-dbname.xml index e9b8c24e1a..255d446d19 100644 --- a/reference/pgsql/functions/pg-dbname.xml +++ b/reference/pgsql/functions/pg-dbname.xml @@ -1,5 +1,5 @@ - + @@ -11,16 +11,42 @@ &reftitle.description; stringpg_dbname - resourceconnection + resourceconnection pg_dbname returns the name of the database that the given PostgreSQL connection - resource. It returns &false;, if connection - is not a valid PostgreSQL connection resource. + resource. + + &reftitle.parameters; + + + + connection + + + PostgreSQL database connection resource. When + connection is not present, the default connection + is used. The default connection is the last connection made by + pg_connect or pg_pconnect. + + + + + + + + + &reftitle.returnvalues; + + A string containing the name of the database the + connection is to, or &false; on error. + + + &reftitle.examples; diff --git a/reference/pgsql/functions/pg-host.xml b/reference/pgsql/functions/pg-host.xml index 5b4227a41c..f51142612f 100644 --- a/reference/pgsql/functions/pg-host.xml +++ b/reference/pgsql/functions/pg-host.xml @@ -1,5 +1,5 @@ - + @@ -13,7 +13,7 @@ &reftitle.description; stringpg_host - resourceconnection + resourceconnection pg_host returns the host name of the given @@ -22,6 +22,56 @@ + + &reftitle.parameters; + + + + connection + + + PostgreSQL database connection resource. When + connection is not present, the default connection + is used. The default connection is the last connection made by + pg_connect or pg_pconnect. + + + + + + + + + &reftitle.returnvalues; + + A string containing the name of the host the + connection is to, or &false; on error. + + + + + &reftitle.examples; + + + <function>pg_host</function> example + +\n"; +} else { + print pg_last_error($pgsql_conn); + exit; +} +?> +]]> + + + + + &reftitle.seealso; diff --git a/reference/pgsql/functions/pg-options.xml b/reference/pgsql/functions/pg-options.xml index 1aa4d6d6f7..b792fe0acc 100644 --- a/reference/pgsql/functions/pg-options.xml +++ b/reference/pgsql/functions/pg-options.xml @@ -1,5 +1,5 @@ - + @@ -11,7 +11,7 @@ &reftitle.description; stringpg_options - resourceconnection + resourceconnection pg_options will return a string containing @@ -19,6 +19,59 @@ connection resource. + + + &reftitle.parameters; + + + + connection + + + PostgreSQL database connection resource. When + connection is not present, the default connection + is used. The default connection is the last connection made by + pg_connect or pg_pconnect. + + + + + + + + + &reftitle.returnvalues; + + A string containing the connection + options, or &false; on error. + + + + + &reftitle.examples; + + + <function>pg_options</function> example + + +]]> + + + + + + + &reftitle.seealso; + + + pg_connect + + + + @@ -11,15 +11,40 @@ &reftitle.description; boolpg_ping - resourceconnection + resourceconnection - pg_ping ping database connection, try to - reconnect if it is broken. It returns &true; if connection is - alive, otherwise &false;. + pg_ping pings a database connection and tries to + reconnect it if it is broken. + + &reftitle.parameters; + + + + connection + + + PostgreSQL database connection resource. When + connection is not present, the default connection + is used. The default connection is the last connection made by + pg_connect or pg_pconnect. + + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + &reftitle.examples; diff --git a/reference/pgsql/functions/pg-port.xml b/reference/pgsql/functions/pg-port.xml index f0936a4495..dfa35e5371 100644 --- a/reference/pgsql/functions/pg-port.xml +++ b/reference/pgsql/functions/pg-port.xml @@ -1,5 +1,5 @@ - + @@ -13,7 +13,7 @@ &reftitle.description; intpg_port - resourceconnection + resourceconnection pg_port returns the port number that the @@ -21,6 +21,57 @@ connected to. + + + &reftitle.parameters; + + + + connection + + + PostgreSQL database connection resource. When + connection is not present, the default connection + is used. The default connection is the last connection made by + pg_connect or pg_pconnect. + + + + + + + + + &reftitle.returnvalues; + + An int containing the port number of the database + server the connection is to, + or &false; on error. + + + + + &reftitle.examples; + + + <function>pg_port</function> example + +\n"; +} else { + print pg_last_error($pgsql_conn); + exit; +} +?> +]]> + + + + + @@ -17,30 +17,89 @@ pg_trace enables tracing of the PostgreSQL - frontend/backend communication to a debugging file specified as - pathname. To fully understand the results, + frontend/backend communication to a 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 + 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 query actually were sent to the - PostgreSQL server. For more information, refer to PostgreSQL - manual. - - - pathname 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. - - - pg_trace returns &true; if - pathname could be opened for logging, - &false; otherwise. + trace.log and see what queries actually were sent to the + PostgreSQL server. For more information, refer to the + PostgreSQL Documentation. + + &reftitle.parameters; + + + + pathname + + + The full path and file name of the file in which to write the + trace log. Same as in fopen. + + + + + pathname + + + An optional file access mode, same as for fopen. + Defaults to "w". + + + + + connection + + + PostgreSQL database connection resource. When + connection is not present, the default connection + is used. The default connection is the last connection made by + pg_connect or pg_pconnect. + + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + &reftitle.examples; + + + <function>pg_trace</function> example + + +]]> + + + + + &reftitle.seealso; diff --git a/reference/pgsql/functions/pg-tty.xml b/reference/pgsql/functions/pg-tty.xml index a530fcfc07..d04401c1a7 100644 --- a/reference/pgsql/functions/pg-tty.xml +++ b/reference/pgsql/functions/pg-tty.xml @@ -1,11 +1,11 @@ - + pg_tty - Return the tty name associated with the connection + Return the TTY name associated with the connection @@ -13,13 +13,70 @@ &reftitle.description; stringpg_tty - resourceconnection + resourceconnection - pg_tty returns the tty name that server + pg_tty returns the TTY name that server side debugging output is sent to on the given PostgreSQL connection resource. + + + pg_tty is obsolete, since the server no longer pays + attention to the TTY setting, but the function remains for backwards + compatibility. + + + + + + &reftitle.parameters; + + + + connection + + + PostgreSQL database connection resource. When + connection is not present, the default connection + is used. The default connection is the last connection made by + pg_connect or pg_pconnect. + + + + + + + + + &reftitle.returnvalues; + + A string containing the the debug TTY of + the connection, or &false; on error. + + + + + &reftitle.examples; + + + <function>pg_tty</function> example + +\n"; +} else { + print pg_last_error($pgsql_conn); + exit; +} +?> +]]> + + + diff --git a/reference/pgsql/functions/pg-untrace.xml b/reference/pgsql/functions/pg-untrace.xml index e9d47276db..ad5fa0d9e9 100644 --- a/reference/pgsql/functions/pg-untrace.xml +++ b/reference/pgsql/functions/pg-untrace.xml @@ -1,5 +1,5 @@ - + @@ -15,14 +15,61 @@ Stop tracing started by pg_trace. - connection specifies the connection that was - traced and defaults to the last one opened. - - - Returns always &true;. + + &reftitle.parameters; + + + + connection + + + PostgreSQL database connection resource. When + connection is not present, the default connection + is used. The default connection is the last connection made by + pg_connect or pg_pconnect. + + + + + + + + + &reftitle.returnvalues; + + Always returns &true;. + + + + + &reftitle.examples; + + + <function>pg_untrace</function> example + + +]]> + + + + + &reftitle.seealso;