mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Fixed many typos, bad grammar and abused tags.
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@77583 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
77a72b9444
commit
8cd6b4541b
1 changed files with 230 additions and 218 deletions
|
@ -1,63 +1,10 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.84 $ -->
|
||||
<!-- $Revision: 1.85 $ -->
|
||||
<reference id="ref.pgsql">
|
||||
<title>PostgreSQL functions</title>
|
||||
<titleabbrev>PostgreSQL</titleabbrev>
|
||||
|
||||
<partintro>
|
||||
<warning>
|
||||
<para>
|
||||
Use of PostgreSQL module with PHP 4.0.6 is not recommended due to
|
||||
a bug in notice message handling.
|
||||
</para>
|
||||
</warning>
|
||||
<warning>
|
||||
<para>
|
||||
PostgreSQL function names will be changed in 4.2.0 release to
|
||||
confirm current coding standard. Most of new names will have
|
||||
additional under score(s), e.g. pg_lo_open(). Some functions are
|
||||
renamed to different name for consistency. e.g. pg_exec() to
|
||||
pg_query(). Older names may be used in 4.2.0 and a few releases
|
||||
from 4.2.0, but they may be deleted in the future. CVS version
|
||||
has new function names.
|
||||
</para>
|
||||
<example>
|
||||
<title>Function names changed</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
OLD NAME NEW NAME
|
||||
pg_exec pg_query
|
||||
pg_getlastoid pg_last_oid
|
||||
pg_cmdtuples pg_affected_rows
|
||||
pg_errormessage pg_last_error
|
||||
pg_numrows pg_num_rows
|
||||
pg_numfields pg_num_fields
|
||||
pg_fieldname pg_field_name
|
||||
pg_fieldsize pg_field_size
|
||||
pg_fieldtype pg_field_type
|
||||
pg_fieldnum pg_field_num
|
||||
pg_fieldprtlen pg_field_prtlen
|
||||
pg_fieldisnull pg_field_is_null
|
||||
pg_freeresult pg_free_result
|
||||
pg_result pg_fetch_result
|
||||
pg_loreadall pg_lo_read_all
|
||||
pg_locreate pg_lo_create
|
||||
pg_lounlink pg_lo_unlink
|
||||
pg_loopen pg_lo_open
|
||||
pg_loclose pg_lo_close
|
||||
pg_loread pg_lo_read
|
||||
pg_lowrite pg_lo_write
|
||||
pg_loimport pg_lo_import
|
||||
pg_loexport pg_lo_export
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Obsolete pg_connect()/pg_pconnect() syntax will be depreciated to
|
||||
support async connect feature in the future. Please use
|
||||
connection string for pg_connect() and pg_pconnect().
|
||||
</para>
|
||||
</warning>
|
||||
<para>
|
||||
Postgres, developed originally in the UC Berkeley Computer Science
|
||||
Department, pioneered many of the object-relational concepts now
|
||||
|
@ -73,17 +20,136 @@ pg_loexport pg_lo_export
|
|||
feature. PostgreSQL supports many character encoding including
|
||||
multibyte character encoding. The current version and more
|
||||
information about PostgreSQL is available at <ulink
|
||||
url="&url.pgsql;">www.postgresql.org</ulink>.
|
||||
url="&url.pgsql;">&url.pgsql;</ulink>.
|
||||
</para>
|
||||
<para>
|
||||
In order to enable PostgreSQL support,
|
||||
"--with-pgsql[=DIR]" is required when you compile
|
||||
<option role="configure">--with-pgsql[=DIR]</option> is required when you compile
|
||||
PHP. If shared object module is available, PostgreSQL module may
|
||||
be loaded using <link linkend="ini.extension">extension</link>
|
||||
directive in &php.ini; or <function>dl</function>
|
||||
function. Supported ini directives are described in
|
||||
<filename>php.ini-dist</filename> file which comes with source distribution.
|
||||
</para>
|
||||
<filename>php.ini-dist</filename> which comes with source distribution.
|
||||
</para>
|
||||
<warning>
|
||||
<para>
|
||||
Using the PostgreSQL module with PHP 4.0.6 is not recommended due to
|
||||
a bug in the notice message handling code. Use 4.1.0 or later.
|
||||
</para>
|
||||
</warning>
|
||||
<warning>
|
||||
<para>
|
||||
PostgreSQL function names will be changed in 4.2.0 release to
|
||||
confirm to current coding standards. Most of new names will have
|
||||
additional underscores, e.g. pg_lo_open(). Some functions are
|
||||
renamed to different name for consistency. e.g. pg_exec() to
|
||||
pg_query(). Older names can be used in 4.2.0 and a few releases
|
||||
from 4.2.0, but they may be deleted in the future.
|
||||
</para>
|
||||
<table>
|
||||
<title>Function names changed</title>
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Old name</entry>
|
||||
<entry>New name</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry><function>pg_exec</function></entry>
|
||||
<entry><function>pg_query</function></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><function>pg_getlastoid</function></entry>
|
||||
<entry><function>pg_last_oid</function></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><function>pg_cmdtuples</function></entry>
|
||||
<entry><function>pg_affected_rows</function></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><function>pg_numrows</function></entry>
|
||||
<entry><function>pg_num_rows</function></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><function>pg_numfields</function></entry>
|
||||
<entry><function>pg_num_fields</function></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><function>pg_fieldname</function></entry>
|
||||
<entry><function>pg_field_name</function></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><function>pg_fieldsize</function></entry>
|
||||
<entry><function>pg_field_size</function></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><function>pg_fieldnum</function></entry>
|
||||
<entry><function>pg_field_num</function></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><function>pg_fieldptrlen</function></entry>
|
||||
<entry><function>pg_field_ptrlen</function></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><function>pg_fieldisnull</function></entry>
|
||||
<entry><function>pg_field_is_null</function></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><function>pg_freeresult</function></entry>
|
||||
<entry><function>pg_free_result</function></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><function>pg_result</function></entry>
|
||||
<entry><function>pg_fetch_result</function></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><function>pg_loreadall</function></entry>
|
||||
<entry><function>pg_lo_read_all</function></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><function>pg_locreate</function></entry>
|
||||
<entry><function>pg_lo_create</function></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><function>pg_lounlink</function></entry>
|
||||
<entry><function>pg_lo_unlink</function></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><function>pg_loopen</function></entry>
|
||||
<entry><function>pg_lo_unlink</function></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><function>pg_loclose</function></entry>
|
||||
<entry><function>pg_lo_close</function></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><function>pg_loread</function></entry>
|
||||
<entry><function>pg_lo_read</function></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><function>pg_lowrite</function></entry>
|
||||
<entry><function>pg_lo_write</function></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><function>pg_loimport</function></entry>
|
||||
<entry><function>pg_lo_import</function></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><function>pg_loexport</function></entry>
|
||||
<entry><function>pg_lo_export</function></entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
<para>
|
||||
The old <function>pg_connect</function>/<function>pg_pconnect</function>
|
||||
syntax will be deprecated to support asynchronous connections in the
|
||||
future. Please use a connection string for <function>pg_connect</function>
|
||||
and <function>pg_pconnect</function>.
|
||||
</para>
|
||||
</warning>
|
||||
<para>
|
||||
Not all functions are supported by all builds. It depends on your
|
||||
libpq (The PostgreSQL C Client interface) version and how libpq is
|
||||
|
@ -98,7 +164,7 @@ pg_loexport pg_lo_export
|
|||
<para>
|
||||
Since version 6.3 (03/02/1998) PostgreSQL uses unix domain sockets
|
||||
by default. TCP port will NOT be opened by default. A table is
|
||||
shown below describing these new connection possibilities. This
|
||||
shown below describing these new connection possibilities. This
|
||||
socket will be found in <filename>/tmp/.s.PGSQL.5432</filename>.
|
||||
This option can be enabled with the '-i' flag to
|
||||
<command>postmaster</command> and it's meaning is: "listen on
|
||||
|
@ -108,36 +174,36 @@ pg_loexport pg_lo_export
|
|||
<tgroup cols="3">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Postmaster</entry>
|
||||
<entry>PHP</entry>
|
||||
<entry>Status</entry>
|
||||
<entry>Postmaster</entry>
|
||||
<entry>PHP</entry>
|
||||
<entry>Status</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>postmaster &</entry>
|
||||
<entry>pg_connect("dbname=MyDbName");</entry>
|
||||
<entry>OK</entry>
|
||||
<entry>postmaster &</entry>
|
||||
<entry>pg_connect("dbname=MyDbName");</entry>
|
||||
<entry>OK</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>postmaster -i &</entry>
|
||||
<entry>pg_connect("dbname=MyDbName");</entry>
|
||||
<entry>OK</entry>
|
||||
<entry>postmaster -i &</entry>
|
||||
<entry>pg_connect("dbname=MyDbName");</entry>
|
||||
<entry>OK</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>postmaster &</entry>
|
||||
<entry>pg_connect("host=localhost dbname=MyDbName");</entry>
|
||||
<entry>
|
||||
Unable to connect to PostgreSQL server: connectDB() failed:
|
||||
Is the postmaster running and accepting TCP/IP (with -i)
|
||||
connection at 'localhost' on port '5432'? in
|
||||
/path/to/file.php on line 20.
|
||||
</entry>
|
||||
<entry>postmaster &</entry>
|
||||
<entry>pg_connect("host=localhost dbname=MyDbName");</entry>
|
||||
<entry>
|
||||
Unable to connect to PostgreSQL server: connectDB() failed:
|
||||
Is the postmaster running and accepting TCP/IP (with -i)
|
||||
connection at 'localhost' on port '5432'? in
|
||||
/path/to/file.php on line 20.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>postmaster -i &</entry>
|
||||
<entry>pg_connect("host=localhost dbname=MyDbName");</entry>
|
||||
<entry>OK</entry>
|
||||
<entry>postmaster -i &</entry>
|
||||
<entry>pg_connect("host=localhost dbname=MyDbName");</entry>
|
||||
<entry>OK</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
|
@ -158,21 +224,21 @@ pg_loexport pg_lo_export
|
|||
has been deprecated.
|
||||
</para>
|
||||
<para>
|
||||
Environmental variable affects PostgreSQL server/client
|
||||
Environmental variables affect PostgreSQL server/client
|
||||
behavior. For example, PostgreSQL module will lookup PGHOST
|
||||
environment variable when hostname is omitted in connection
|
||||
environment variable when the hostname is omitted in the connection
|
||||
string. Supported environment variables are different from version
|
||||
to version. Refer to PostgreSQL Programmer's Manual (libpq -
|
||||
Environment Variables) for details.
|
||||
</para>
|
||||
<para>
|
||||
Make sure you set environment variables for appropriate user. Use
|
||||
<literal>$_ENV</literal> or <function>getenv</function> to check
|
||||
environment variables available to current process.
|
||||
<literal>$_ENV</literal> or <function>getenv</function> to check
|
||||
which environment variables are available to the current process.
|
||||
</para>
|
||||
<example>
|
||||
<title>Setting default parameters</title>
|
||||
<programlisting role="php">
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
PGHOST=psgql.exmaple.com
|
||||
PGPORT=7890
|
||||
|
@ -188,18 +254,18 @@ export PGHOST PGPORT PGDATABASE PGUSER PGPASSWORD PGDATESTYLE PGTZ PGCLIENTENCOD
|
|||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
From PostgreSQL 7.1.0, text data type has 1GB as its max
|
||||
size. Older PostgreSQL's text data type is limited by block
|
||||
size. (Default 8KB. Max 32KB defined at compile time)
|
||||
Starting with PostgreSQL 7.1.0, you can store up to 1GB into a
|
||||
field of type text. In older versions, this was limited to the block
|
||||
size (default was 8KB, maximum was 32KB, defined at compile time)
|
||||
</para>
|
||||
<para>
|
||||
To use the large object (lo) interface, it is required to enclose
|
||||
large object functions within a transaction block. A transaction
|
||||
block starts with a SQL statement <command>begin</command> and if
|
||||
the transaction was valid ends with <command>commit</command> or
|
||||
<command>end</command>. If the transaction fails the transaction
|
||||
should be closed with <command>rollback</command> or
|
||||
<command>abort</command>.
|
||||
block starts with a SQL statement <command>BEGIN</command> and if
|
||||
the transaction was valid ends with <command>COMMIT</command> or
|
||||
<command>END</command>. If the transaction fails the transaction
|
||||
should be closed with <command>ROLLBACK</command> or
|
||||
<command>ABORT</command>.
|
||||
<example>
|
||||
<title>Using Large Objects</title>
|
||||
<programlisting role="php">
|
||||
|
@ -208,9 +274,9 @@ export PGHOST PGPORT PGDATABASE PGUSER PGPASSWORD PGDATESTYLE PGTZ PGCLIENTENCOD
|
|||
$database = pg_connect ("dbname=jacarta");
|
||||
pg_query ($database, "begin");
|
||||
$oid = pg_lo_create ($database);
|
||||
echo ("$oid\n");
|
||||
echo "$oid\n";
|
||||
$handle = pg_lo_open ($database, $oid, "w");
|
||||
echo ("$handle\n");
|
||||
echo "$handle\n";
|
||||
pg_lo_write ($handle, "large object data");
|
||||
pg_lo_close ($handle);
|
||||
pg_query ($database, "commit");
|
||||
|
@ -218,8 +284,8 @@ export PGHOST PGPORT PGDATABASE PGUSER PGPASSWORD PGDATESTYLE PGTZ PGCLIENTENCOD
|
|||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
Do not close connection resource before closing large object
|
||||
resource.
|
||||
You should not close the connection to the PostgreSQL server
|
||||
before closing the large object.
|
||||
</para>
|
||||
</partintro>
|
||||
|
||||
|
@ -256,7 +322,7 @@ echo $cmdtuples . " tuples are affected.";
|
|||
</para>
|
||||
<note>
|
||||
<para>
|
||||
This function used called <literal>pg_cmdtuples()</literal>.
|
||||
This function used to be called <literal>pg_cmdtuples()</literal>.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
|
@ -285,9 +351,9 @@ echo $cmdtuples . " tuples are affected.";
|
|||
</para>
|
||||
<para>
|
||||
<function>pg_connect</function> opens a connection to a
|
||||
PostgreSQL database specified by
|
||||
PostgreSQL database specified by the
|
||||
<parameter>connection_string</parameter>. It returns a connection
|
||||
resource on success. It returns &false;, if the connection could
|
||||
resource on success. It returns &false; if the connection could
|
||||
not be made. <parameter>connection_string</parameter> should be
|
||||
a quoted string.
|
||||
<example>
|
||||
|
@ -317,17 +383,16 @@ $dbconn4 = pg_connect ($conn_string);
|
|||
</para>
|
||||
<para>
|
||||
If a second call is made to <function>pg_connect</function> with
|
||||
the same <parameter>connection_string</parameter> arguments, no
|
||||
the same <parameter>connection_string</parameter>, no
|
||||
new connection will be established, but instead, the connection
|
||||
resource of the already opened connection will be returned. You
|
||||
can have multiple connections to the same database if you use
|
||||
different connection string.
|
||||
</para>
|
||||
<para>
|
||||
Syntax supports multiple parameters:
|
||||
The old syntax with multiple parameters
|
||||
<command>$conn = pg_connect ("host", "port", "options", "tty", "dbname")
|
||||
</command>
|
||||
has been deprecated.
|
||||
</command> has been deprecated.
|
||||
</para>
|
||||
<para>
|
||||
See also <function>pg_pconnect</function>,
|
||||
|
@ -353,64 +418,27 @@ $dbconn4 = pg_connect ($conn_string);
|
|||
</methodsynopsis>
|
||||
<para>
|
||||
<function>pg_pconnect</function> opens a connection to a
|
||||
PostgreSQL database. It returns a connection resource that is
|
||||
PostgreSQL database. It returns a connection resource that is
|
||||
needed by other PostgreSQL functions.
|
||||
</para>
|
||||
<para>
|
||||
It returns a connection resource on success, or &false; if the
|
||||
connection could not be made. The arguments should be within a
|
||||
quoted string. The arguments available include
|
||||
<parameter>host</parameter>, <parameter>port</parameter>,
|
||||
<parameter>tty</parameter>, <parameter>options</parameter>,
|
||||
<parameter>dbname</parameter>, <parameter>user</parameter>, and
|
||||
<parameter>password</parameter>.
|
||||
</para>
|
||||
<example>
|
||||
<title>Using pg_pconnect</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$dbconn = pg_connect ("dbname=mary");
|
||||
//connect to a database named "mary"
|
||||
$dbconn2 = pg_connect ("host=localhost port=5432 dbname=mary");
|
||||
// connect to a database named "mary" on "localhost" at port "5432"
|
||||
$dbconn3 = pg_connect ("host=sheep port=5432 dbname=mary user=lamb password=foo");
|
||||
//connect to a database named "mary" on the host "sheep" with a username and password
|
||||
$conn_string = "host=sheep port=5432 dbname=test user=lamb password=bar";
|
||||
$dbconn4 = pg_connect ($conn_string);
|
||||
//connect to a database named "test" on the host "sheep" with a username and password
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
If a second call is made to <function>pg_pconnect</function> with
|
||||
the same arguments, no new connection will be established, but
|
||||
instead, the connection resource of the already opened connection
|
||||
will be returned. You can have multiple connections to the same
|
||||
database if you use different connection string.
|
||||
For a description of the <parameter>connection_string</parameter>
|
||||
parameter, see <function>pg_connect</function>.
|
||||
</para>
|
||||
<para>
|
||||
Multiple parameters syntax for <function>pg_pconnect</function>
|
||||
<command>$conn = pg_pconnect ("host", "port", "options", "tty",
|
||||
"dbname")
|
||||
</command>
|
||||
has been deprecated.
|
||||
</para>
|
||||
<para>
|
||||
To enable persistent connection, <link
|
||||
To enable persistent connection, the <link
|
||||
linkend="ini.pgsql.allow-persistent">pgsql.allow_persistent</link>
|
||||
&php.ini; directive must be set to "On". (Default is On)
|
||||
Max number of persistent connection can be defined by <link
|
||||
&php.ini; directive must be set to "On" (which is the default).
|
||||
The maximum number of persistent connection can be defined with the <link
|
||||
linkend="ini.pgsql.max-persistent">pgsql.max_persistent</link>
|
||||
&php.ini; directive. (Default is -1 which is no limit) Total number
|
||||
of connection can be set by <link
|
||||
&php.ini; directive (defaults to -1 for no limit). The total number
|
||||
of connections can be set with the <link
|
||||
linkend="ini.pgsql.max-links">pgsql.max_links</link>
|
||||
&php.ini; directive.
|
||||
</para>
|
||||
<para>
|
||||
<function>pg_close</function> will not close persistent links
|
||||
generated by <function>pg_pconnect</function>.
|
||||
generated by <function>pg_pconnect</function>.
|
||||
</para>
|
||||
<para>
|
||||
See also <function>pg_connect</function>.
|
||||
|
@ -434,11 +462,9 @@ $dbconn4 = pg_connect ($conn_string);
|
|||
<methodparam><type>resource</type><parameter>connection</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>pg_connection_busy</function> returns &true; if
|
||||
connection busy. If connection is busy, previously sent query to
|
||||
PostgreSQL server is still executing. If
|
||||
<function>pg_get_result</function> is called,
|
||||
<function>pg_get_result</function> will block.
|
||||
<function>pg_connection_busy</function> returns &true; if the
|
||||
connection is busy. If it's is busy, a previous query is still executing.
|
||||
If <function>pg_get_result</function> is called, it will be blocked.
|
||||
</para>
|
||||
<para>
|
||||
See also <function>pg_connection_status</function> and
|
||||
|
@ -463,10 +489,8 @@ $dbconn4 = pg_connect ($conn_string);
|
|||
<methodparam><type>resource</type><parameter>connection</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>pg_connection_reset</function> reset connection with
|
||||
the same parameter when connection is made. It is useful for
|
||||
error recovery. It returns &true; if it resets connection
|
||||
successfully, otherwise returns &false;.
|
||||
<function>pg_connection_reset</function> resets the connection.
|
||||
It is useful for error recovery. &return.success;
|
||||
</para>
|
||||
<para>
|
||||
See also <function>pg_connect</function>,
|
||||
|
@ -493,11 +517,11 @@ $dbconn4 = pg_connect ($conn_string);
|
|||
</methodsynopsis>
|
||||
<para>
|
||||
<function>pg_connection_status</function> returns a connection
|
||||
status. Possible status is <literal>PGSQL_CONNECTION_OK</literal>
|
||||
or <literal>PGSQL_CONNECTION_BAD</literal>.
|
||||
status. Possible statuses are <literal>PGSQL_CONNECTION_OK</literal>
|
||||
and <literal>PGSQL_CONNECTION_BAD</literal>.
|
||||
</para>
|
||||
<para>
|
||||
See also <function>pg_connection_busy</function>
|
||||
See also <function>pg_connection_busy</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
@ -516,19 +540,15 @@ $dbconn4 = pg_connect ($conn_string);
|
|||
<methodparam><type>resource</type><parameter>connection</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>pg_close</function> closes down the non-persistent
|
||||
<function>pg_close</function> closes the non-persistent
|
||||
connection to a PostgreSQL database associated with the given
|
||||
<parameter>connection</parameter> resource. It returns &true;, if
|
||||
<parameter>connection</parameter> is a valid connection resource,
|
||||
otherwise it return &false;.
|
||||
<parameter>connection</parameter> resource. &return.success;
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
<function>pg_close</function> is not usually necessary, as
|
||||
non-persistent open links are automatically closed at the end of
|
||||
the script's execution. <function>pg_close</function> will not
|
||||
close persistent links generated by
|
||||
<function>pg_pconnect</function>.
|
||||
Using <function>pg_close</function> is not usually necessary, as
|
||||
non-persistent open connections are automatically closed at the end
|
||||
of the script.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
|
@ -544,7 +564,7 @@ $dbconn4 = pg_connect ($conn_string);
|
|||
<refnamediv>
|
||||
<refname>pg_copy_from</refname>
|
||||
<refpurpose>
|
||||
Copy table from array
|
||||
Copy a table from an array
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
|
@ -558,8 +578,8 @@ $dbconn4 = pg_connect ($conn_string);
|
|||
<methodparam choice="opt"><type>string</type><parameter>null_as</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>pg_copy_from</function> copy table from array. It
|
||||
return &true; for success, otherwise &false;.
|
||||
<function>pg_copy_from</function> copies a table from an array.
|
||||
&return.success;
|
||||
</para>
|
||||
<para>
|
||||
See also <function>pg_copy_to</function>
|
||||
|
@ -573,7 +593,7 @@ $dbconn4 = pg_connect ($conn_string);
|
|||
<refnamediv>
|
||||
<refname>pg_copy_to</refname>
|
||||
<refpurpose>
|
||||
Copy table to array
|
||||
Copy a table to an array
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
|
@ -586,9 +606,8 @@ $dbconn4 = pg_connect ($conn_string);
|
|||
<methodparam choice="opt"><type>string</type><parameter>null_as</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>pg_copy_to</function> copy table to array. The result
|
||||
array is returned if it success to copy. Otherwise it returns
|
||||
&false;.
|
||||
<function>pg_copy_to</function> copies a table to an array. The
|
||||
resulting array is returned. It returns &false; on failure.
|
||||
</para>
|
||||
<para>
|
||||
See also <function>pg_copy_from</function>
|
||||
|
@ -610,13 +629,12 @@ $dbconn4 = pg_connect ($conn_string);
|
|||
<methodparam choice="opt"><type>resource</type><parameter>connection</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>pg_end_copy</function> syncs PostgreSQL frontend
|
||||
<function>pg_end_copy</function> syncs the PostgreSQL frontend
|
||||
(usually a web server process) with the PostgreSQL server after
|
||||
doing a copy operation performed by
|
||||
<function>pg_put_line</function>. <function>pg_end_copy</function>
|
||||
must be issued, otherwise the PostgreSQL server may get "out of
|
||||
sync" error with the frontend. It returns &true; for success,
|
||||
otherwise it returns &false;.
|
||||
must be issued, otherwise the PostgreSQL server may get out of
|
||||
sync with the frontend and will report an error. &return.success;
|
||||
</para>
|
||||
<para>
|
||||
For further details and an example, see also
|
||||
|
@ -644,13 +662,12 @@ $dbconn4 = pg_connect ($conn_string);
|
|||
to the PostgreSQL backend server. This is useful for example for
|
||||
very high-speed inserting of data into a table, initiated by
|
||||
starting a PostgreSQL copy-operation. That final NULL-character
|
||||
is added automatically. It returns &true; if successful, &false;
|
||||
otherwise.
|
||||
is added automatically. &return.success;
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
Note the application must explicitly send the two characters "\."
|
||||
on a final line to indicate to the backend that it has finished
|
||||
The application must explicitly send the two characters "\."
|
||||
on the last line to indicate to the backend that it has finished
|
||||
sending its data.
|
||||
</para>
|
||||
</note>
|
||||
|
@ -689,26 +706,21 @@ $dbconn4 = pg_connect ($conn_string);
|
|||
<type>string</type><methodname>pg_last_error</methodname>
|
||||
<methodparam><type>resource</type><parameter>connection</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>pg_last_error</function> returns a string containing
|
||||
the last error message for given
|
||||
<parameter>connection</parameter>. It returns &false; on failure.
|
||||
</para>
|
||||
<para>
|
||||
<function>pg_last_error</function> returns the last error
|
||||
message for given <parameter>connection</parameter> and error
|
||||
message may be overwritten if other libpq functions are called on
|
||||
the connection. PostgreSQL functions calls libpq functions
|
||||
internally. Therefore, details about the error may not be
|
||||
retrieved using the <function>pg_last_error</function>
|
||||
function. pg_result_error_message() will be added from 4.2.0 to
|
||||
get last error for the result resource.
|
||||
message for given <parameter>connection</parameter>. Errormessages
|
||||
may be overwritten by calls to other PostgreSQL functions, so make
|
||||
sure you call <function>pg_last_error</function> before any other
|
||||
PostgreSQL functions.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
This function used called <literal>pg_errormessage()</literal>.
|
||||
This function used to be called <literal>pg_errormessage()</literal>.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
See also <function>pg_result_error_message</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
|
@ -792,7 +804,7 @@ $dbconn4 = pg_connect ($conn_string);
|
|||
</para>
|
||||
<note>
|
||||
<para>
|
||||
This function used called <literal>pg_getlastoid()</literal>.
|
||||
This function used to be called <literal>pg_getlastoid()</literal>.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
|
@ -848,7 +860,7 @@ $dbconn4 = pg_connect ($conn_string);
|
|||
</para>
|
||||
<note>
|
||||
<para>
|
||||
This function used called <literal>pg_exec()</literal>.
|
||||
This function used to be called <literal>pg_exec()</literal>.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
|
@ -1208,7 +1220,7 @@ for ($i=0; $i < $num; $i++) {
|
|||
</para>
|
||||
<note>
|
||||
<para>
|
||||
This function used called <literal>pg_fieldisnull()</literal>.
|
||||
This function used to be called <literal>pg_fieldisnull()</literal>.
|
||||
</para>
|
||||
</note>
|
||||
</refsect1>
|
||||
|
@ -1236,7 +1248,7 @@ for ($i=0; $i < $num; $i++) {
|
|||
</para>
|
||||
<note>
|
||||
<para>
|
||||
This function used called <literal>pg_fieldname()</literal>.
|
||||
This function used to be called <literal>pg_fieldname()</literal>.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
|
@ -1268,7 +1280,7 @@ for ($i=0; $i < $num; $i++) {
|
|||
</para>
|
||||
<note>
|
||||
<para>
|
||||
This function used called <literal>pg_fieldnum()</literal>.
|
||||
This function used to be called <literal>pg_fieldnum()</literal>.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
|
@ -1300,7 +1312,7 @@ for ($i=0; $i < $num; $i++) {
|
|||
</para>
|
||||
<note>
|
||||
<para>
|
||||
This function used called <literal>pg_field_prtlen()</literal>.
|
||||
This function used to be called <literal>pg_field_prtlen()</literal>.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
|
@ -1334,7 +1346,7 @@ for ($i=0; $i < $num; $i++) {
|
|||
</para>
|
||||
<note>
|
||||
<para>
|
||||
This function used called <literal>pg_fieldsize()</literal>.
|
||||
This function used to be called <literal>pg_fieldsize()</literal>.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
|
@ -1367,7 +1379,7 @@ for ($i=0; $i < $num; $i++) {
|
|||
</para>
|
||||
<note>
|
||||
<para>
|
||||
This function used called <literal>pg_field_type()</literal>.
|
||||
This function used to be called <literal>pg_field_type()</literal>.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
|
@ -1402,7 +1414,7 @@ for ($i=0; $i < $num; $i++) {
|
|||
</para>
|
||||
<note>
|
||||
<para>
|
||||
This function used called <literal>pg_field_len()</literal>.
|
||||
This function used to be called <literal>pg_field_len()</literal>.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
|
@ -1435,7 +1447,7 @@ for ($i=0; $i < $num; $i++) {
|
|||
</para>
|
||||
<note>
|
||||
<para>
|
||||
This function used called <literal>pg_loclose()</literal>.
|
||||
This function used to be called <literal>pg_loclose()</literal>.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
|
@ -1478,7 +1490,7 @@ for ($i=0; $i < $num; $i++) {
|
|||
</para>
|
||||
<note>
|
||||
<para>
|
||||
This function used called <literal>pg_locreate()</literal>.
|
||||
This function used to be called <literal>pg_locreate()</literal>.
|
||||
</para>
|
||||
</note>
|
||||
</refsect1>
|
||||
|
@ -1511,7 +1523,7 @@ for ($i=0; $i < $num; $i++) {
|
|||
</para>
|
||||
<note>
|
||||
<para>
|
||||
This function used called <literal>pg_loexport()</literal>.
|
||||
This function used to be called <literal>pg_loexport()</literal>.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
|
@ -1547,7 +1559,7 @@ for ($i=0; $i < $num; $i++) {
|
|||
¬e.sm.uidcheck;
|
||||
<note>
|
||||
<para>
|
||||
This function used called <literal>pg_loimport()</literal>.
|
||||
This function used to be called <literal>pg_loimport()</literal>.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
|
@ -1592,7 +1604,7 @@ for ($i=0; $i < $num; $i++) {
|
|||
</para>
|
||||
<note>
|
||||
<para>
|
||||
This function used called <literal>pg_loopen()</literal>.
|
||||
This function used to be called <literal>pg_loopen()</literal>.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
|
@ -1630,7 +1642,7 @@ for ($i=0; $i < $num; $i++) {
|
|||
</para>
|
||||
<note>
|
||||
<para>
|
||||
This function used called <literal>pg_loraed()</literal>.
|
||||
This function used to be called <literal>pg_loread()</literal>.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
|
@ -1720,7 +1732,7 @@ for ($i=0; $i < $num; $i++) {
|
|||
</para>
|
||||
<note>
|
||||
<para>
|
||||
This function used called <literal>pg_loreadall()</literal>.
|
||||
This function used to be called <literal>pg_loreadall()</literal>.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
|
@ -1754,7 +1766,7 @@ for ($i=0; $i < $num; $i++) {
|
|||
</para>
|
||||
<note>
|
||||
<para>
|
||||
This function used called <literal>pg_lo_unlink()</literal>.
|
||||
This function used to be called <literal>pg_lo_unlink()</literal>.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
|
@ -1791,7 +1803,7 @@ for ($i=0; $i < $num; $i++) {
|
|||
</para>
|
||||
<note>
|
||||
<para>
|
||||
This function used called <literal>pg_lo_write()</literal>.
|
||||
This function used to be called <literal>pg_lo_write()</literal>.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
|
@ -1823,7 +1835,7 @@ for ($i=0; $i < $num; $i++) {
|
|||
</para>
|
||||
<note>
|
||||
<para>
|
||||
This function used called <literal>pg_numfields()</literal>.
|
||||
This function used to be called <literal>pg_numfields()</literal>.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
|
@ -1861,7 +1873,7 @@ for ($i=0; $i < $num; $i++) {
|
|||
</note>
|
||||
<note>
|
||||
<para>
|
||||
This function used called <literal>pg_num_rows()</literal>.
|
||||
This function used to be called <literal>pg_num_rows()</literal>.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
|
|
Loading…
Reference in a new issue