mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 08:58:56 +00:00
- Documented newly added functions pg_end_copy, pg_put_line.
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@32516 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
9d7ef6d92a
commit
178f563c08
1 changed files with 79 additions and 0 deletions
|
@ -237,6 +237,34 @@ $dbconn3 = pg_Connect ("user=lamb passwd=baaaa dbname=mary ");
|
|||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<refentry id="function.pg-end-copy">
|
||||
<refnamediv>
|
||||
<refname>pg_end_copy</refname>
|
||||
<refpurpose>Sync with PostgreSQL backend</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
<funcdef>bool <function>pg_end_copy</function></funcdef>
|
||||
<paramdef>resource
|
||||
<parameter><optional>connection</optional></parameter>
|
||||
</paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para>
|
||||
<function>pg_end_copy</function> syncs PostgreSQL frontend with
|
||||
the backend after doing a copy operation. It must be issued or
|
||||
the backend may get "out of sync" with the frontend. Returns
|
||||
TRUE if successfull, FALSE otherwise.
|
||||
</para>
|
||||
<para>
|
||||
For further details and an example, see also
|
||||
<function>pg_put_line</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<refentry id="function.pg-errormessage">
|
||||
<refnamediv>
|
||||
<refname>pg_errormessage</refname>
|
||||
|
@ -1056,6 +1084,57 @@ for ($i=0; $i<$num; $i++) {
|
|||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<refentry id="function.pg-put-line">
|
||||
<refnamediv>
|
||||
<refname>pg_put_line</refname>
|
||||
<refpurpose>Send a NULL-terminated string to PostgreSQL backend</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
<funcdef>bool <function>pg_put_line</function></funcdef>
|
||||
<paramdef>resource
|
||||
<parameter><optional>connection_id</optional></parameter>
|
||||
</paramdef>
|
||||
<paramdef>string <parameter>data</parameter></paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para>
|
||||
<function>pg_put_line</function> sends a NULL-terminated 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. Returns TRUE if successfull, FALSE
|
||||
otherwise.
|
||||
</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
|
||||
sending its data.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
See also <function>pg_end_copy</function>.
|
||||
<example>
|
||||
<title>High-speed insertion of data into a table</title>
|
||||
<programlisting role="php">
|
||||
<?php
|
||||
$conn = pg_pconnect ("dbname=foo");
|
||||
pg_exec($conn, "create table bar (a int4, b char(16), d float8)");
|
||||
pg_exec($conn, "copy bar from stdin");
|
||||
pg_put_line($conn, "3\thello world\t4.5\n");
|
||||
pg_put_line($conn, "4\tgoodbye world\t7.11\n");
|
||||
pg_put_line($conn, "\\.\n");
|
||||
pg_end_copy($conn);
|
||||
?>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<refentry id="function.pg-result">
|
||||
<refnamediv>
|
||||
<refname>pg_result</refname>
|
||||
|
|
Loading…
Reference in a new issue