mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-26 13:58:55 +00:00

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@78496 c90b9560-bf6c-de11-be94-00142212c4b1
71 lines
2.2 KiB
XML
71 lines
2.2 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.2 $ -->
|
|
<!-- splitted from ./en/functions/pgsql.xml, last change in rev 1.20 -->
|
|
<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>
|
|
<methodsynopsis>
|
|
<type>bool</type><methodname>pg_put_line</methodname>
|
|
<methodparam choice="opt"><type>resource</type><parameter>connection</parameter></methodparam>
|
|
<methodparam><type>string</type><parameter>data</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<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. &return.success;
|
|
</para>
|
|
<note>
|
|
<para>
|
|
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>
|
|
<para>
|
|
See also <function>pg_end_copy</function>.
|
|
<example>
|
|
<title>High-speed insertion of data into a table</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$conn = pg_pconnect ("dbname=foo");
|
|
pg_query($conn, "create table bar (a int4, b char(16), d float8)");
|
|
pg_query($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>
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"../../../../manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|