2002-04-15 00:12:54 +00:00
|
|
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
2005-04-14 03:21:36 +00:00
|
|
|
<!-- $Revision: 1.6 $ -->
|
2002-04-15 00:12:54 +00:00
|
|
|
<!-- splitted from ./en/functions/pgsql.xml, last change in rev 1.2 -->
|
2005-03-08 00:06:33 +00:00
|
|
|
<refentry id="function.pg-lo-open">
|
|
|
|
<refnamediv>
|
|
|
|
<refname>pg_lo_open</refname>
|
|
|
|
<refpurpose>Open a large object</refpurpose>
|
|
|
|
</refnamediv>
|
2005-03-11 16:03:26 +00:00
|
|
|
|
|
|
|
<refsect1 role="description">
|
|
|
|
&reftitle.description;
|
2005-03-08 00:06:33 +00:00
|
|
|
<methodsynopsis>
|
|
|
|
<type>resource</type><methodname>pg_lo_open</methodname>
|
|
|
|
<methodparam><type>resource</type><parameter>connection</parameter></methodparam>
|
|
|
|
<methodparam><type>int</type><parameter>oid</parameter></methodparam>
|
|
|
|
<methodparam><type>string</type><parameter>mode</parameter></methodparam>
|
|
|
|
</methodsynopsis>
|
|
|
|
<para>
|
2005-04-14 03:21:36 +00:00
|
|
|
<function>pg_lo_open</function> opens a large object in the database
|
|
|
|
and returns large object resource so that it can be manipulated.
|
2005-03-08 00:06:33 +00:00
|
|
|
</para>
|
|
|
|
<warning>
|
|
|
|
<para>
|
|
|
|
Do not close the database connection before closing the large
|
|
|
|
object resource.
|
|
|
|
</para>
|
|
|
|
</warning>
|
|
|
|
<para>
|
2005-04-14 03:21:36 +00:00
|
|
|
To use the large object interface, it is necessary to
|
2005-03-08 00:06:33 +00:00
|
|
|
enclose it within a transaction block.
|
|
|
|
</para>
|
|
|
|
<note>
|
|
|
|
<para>
|
|
|
|
This function used to be called <literal>pg_loopen()</literal>.
|
|
|
|
</para>
|
|
|
|
</note>
|
2005-03-11 16:03:26 +00:00
|
|
|
</refsect1>
|
2005-04-14 03:21:36 +00:00
|
|
|
|
|
|
|
<refsect1 role="parameters">
|
|
|
|
&reftitle.parameters;
|
|
|
|
<para>
|
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
|
|
|
<term><parameter>connection</parameter></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
PostgreSQL database connection resource. When
|
|
|
|
<parameter>connection</parameter> is not present, the default connection
|
|
|
|
is used. The default connection is the last connection made by
|
|
|
|
<function>pg_connect</function> or <function>pg_pconnect</function>.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
|
|
<term><parameter>oid</parameter></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
The <varname>OID</varname> of the large object in the database.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
|
|
<term><parameter>mode</parameter></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Can be either "r" for read-only, "w" for write only or "rw" for read and
|
|
|
|
write.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
2005-03-11 16:03:26 +00:00
|
|
|
|
2005-04-14 03:21:36 +00:00
|
|
|
<refsect1 role="returnvalues">
|
|
|
|
&reftitle.returnvalues;
|
|
|
|
<para>
|
|
|
|
A large object resource or &false; on error.
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 role="examples">
|
|
|
|
&reftitle.examples;
|
|
|
|
<para>
|
|
|
|
<example>
|
|
|
|
<title><function>pg_lo_open</function> example</title>
|
|
|
|
<programlisting role="php">
|
|
|
|
<![CDATA[
|
|
|
|
<?php
|
|
|
|
$database = pg_connect("dbname=jacarta");
|
|
|
|
pg_query($database, "begin");
|
|
|
|
$oid = pg_lo_create($database);
|
|
|
|
echo "$oid\n";
|
|
|
|
$handle = pg_lo_open($database, $oid, "w");
|
|
|
|
echo "$handle\n";
|
|
|
|
pg_lo_write($handle, "large object data");
|
|
|
|
pg_lo_close($handle);
|
|
|
|
pg_query($database, "commit");
|
|
|
|
?>
|
|
|
|
]]>
|
|
|
|
</programlisting>
|
|
|
|
</example>
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
2005-03-11 16:03:26 +00:00
|
|
|
<refsect1 role="seealso">
|
|
|
|
&reftitle.seealso;
|
2005-03-08 00:06:33 +00:00
|
|
|
<para>
|
2005-03-11 16:03:26 +00:00
|
|
|
<simplelist>
|
|
|
|
<member><function>pg_lo_close</function></member>
|
|
|
|
<member><function>pg_lo_create</function></member>
|
|
|
|
</simplelist>
|
2005-03-08 00:06:33 +00:00
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
</refentry>
|
2002-04-15 00:12:54 +00:00
|
|
|
|
|
|
|
<!-- 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
|
|
|
|
-->
|