Commit 797c2b25 authored by Tom Lane's avatar Tom Lane

More minor updates and copy-editing.

parent 7737d01e
<!-- <!--
$PostgreSQL: pgsql/doc/src/sgml/ecpg.sgml,v 1.59 2003/12/26 20:00:00 meskes Exp $ $PostgreSQL: pgsql/doc/src/sgml/ecpg.sgml,v 1.60 2004/12/28 22:47:15 tgl Exp $
--> -->
<chapter id="ecpg"> <chapter id="ecpg">
...@@ -19,7 +19,7 @@ $PostgreSQL: pgsql/doc/src/sgml/ecpg.sgml,v 1.59 2003/12/26 20:00:00 meskes Exp ...@@ -19,7 +19,7 @@ $PostgreSQL: pgsql/doc/src/sgml/ecpg.sgml,v 1.59 2003/12/26 20:00:00 meskes Exp
</para> </para>
<para> <para>
Admittedly, this documentation is quite incomplete. But since this This documentation is quite incomplete. But since this
interface is standardized, additional information can be found in interface is standardized, additional information can be found in
many resources about SQL. many resources about SQL.
</para> </para>
...@@ -31,9 +31,9 @@ $PostgreSQL: pgsql/doc/src/sgml/ecpg.sgml,v 1.59 2003/12/26 20:00:00 meskes Exp ...@@ -31,9 +31,9 @@ $PostgreSQL: pgsql/doc/src/sgml/ecpg.sgml,v 1.59 2003/12/26 20:00:00 meskes Exp
An embedded SQL program consists of code written in an ordinary An embedded SQL program consists of code written in an ordinary
programming language, in this case C, mixed with SQL commands in programming language, in this case C, mixed with SQL commands in
specially marked sections. To build the program, the source code specially marked sections. To build the program, the source code
is first passed to the embedded SQL preprocessor, which converts it is first passed through the embedded SQL preprocessor, which converts it
to an ordinary C program, and afterwards it can be processed by a C to an ordinary C program, and afterwards it can be processed by a C
compilation tool chain. compiler.
</para> </para>
<para> <para>
...@@ -53,7 +53,7 @@ $PostgreSQL: pgsql/doc/src/sgml/ecpg.sgml,v 1.59 2003/12/26 20:00:00 meskes Exp ...@@ -53,7 +53,7 @@ $PostgreSQL: pgsql/doc/src/sgml/ecpg.sgml,v 1.59 2003/12/26 20:00:00 meskes Exp
</para> </para>
<para> <para>
As indicated, programs written for the embedded As already stated, programs written for the embedded
<acronym>SQL</acronym> interface are normal C programs with special <acronym>SQL</acronym> interface are normal C programs with special
code inserted to perform database-related actions. This special code inserted to perform database-related actions. This special
code always has the form code always has the form
...@@ -61,8 +61,8 @@ $PostgreSQL: pgsql/doc/src/sgml/ecpg.sgml,v 1.59 2003/12/26 20:00:00 meskes Exp ...@@ -61,8 +61,8 @@ $PostgreSQL: pgsql/doc/src/sgml/ecpg.sgml,v 1.59 2003/12/26 20:00:00 meskes Exp
EXEC SQL ...; EXEC SQL ...;
</programlisting> </programlisting>
These statements syntactically take the place of a C statement. These statements syntactically take the place of a C statement.
Depending on the particular statement, they may appear in the Depending on the particular statement, they may appear at the
global context or within a function. Embedded global level or within a function. Embedded
<acronym>SQL</acronym> statements follow the case-sensitivity rules <acronym>SQL</acronym> statements follow the case-sensitivity rules
of normal <acronym>SQL</acronym> code, and not those of C. of normal <acronym>SQL</acronym> code, and not those of C.
</para> </para>
...@@ -326,9 +326,9 @@ EXEC SQL COMMIT; ...@@ -326,9 +326,9 @@ EXEC SQL COMMIT;
<para> <para>
In the default mode, statements are committed only when In the default mode, statements are committed only when
<command>EXEC SQL COMMIT</command> is issued. The embedded SQL <command>EXEC SQL COMMIT</command> is issued. The embedded SQL
interface also supports autocommit of transactions (as known from interface also supports autocommit of transactions (similar to
other interfaces) via the <option>-t</option> command-line option <application>libpq</> behavior) via the <option>-t</option> command-line
to <command>ecpg</command> (see below) or via the <literal>EXEC SQL option to <command>ecpg</command> (see below) or via the <literal>EXEC SQL
SET AUTOCOMMIT TO ON</literal> statement. In autocommit mode, each SET AUTOCOMMIT TO ON</literal> statement. In autocommit mode, each
command is automatically committed unless it is inside an explicit command is automatically committed unless it is inside an explicit
transaction block. This mode can be explicitly turned off using transaction block. This mode can be explicitly turned off using
...@@ -448,7 +448,7 @@ char foo[16], bar[16]; ...@@ -448,7 +448,7 @@ char foo[16], bar[16];
<para> <para>
The declarations are also echoed to the output file as a normal C The declarations are also echoed to the output file as a normal C
variables, so there's no need to declare them again. Variables variables, so there's no need to declare them again. Variables
that are not intended to be used with SQL commands can be declared that are not intended to be used in SQL commands can be declared
normally outside these special sections. normally outside these special sections.
</para> </para>
...@@ -553,7 +553,7 @@ do { ...@@ -553,7 +553,7 @@ do {
second host variable specification to each host variable that second host variable specification to each host variable that
contains data. This second host variable is called the contains data. This second host variable is called the
<firstterm>indicator</firstterm> and contains a flag that tells <firstterm>indicator</firstterm> and contains a flag that tells
whether the datums is null, in which case the value of the real whether the datum is null, in which case the value of the real
host variable is ignored. Here is an example that handles the host variable is ignored. Here is an example that handles the
retrieval of null values correctly: retrieval of null values correctly:
<programlisting> <programlisting>
...@@ -1043,7 +1043,7 @@ static void set_error_handler(void) ...@@ -1043,7 +1043,7 @@ static void set_error_handler(void)
<title>sqlca</title> <title>sqlca</title>
<para> <para>
For a more powerful error handling, the embedded SQL interface For more powerful error handling, the embedded SQL interface
provides a global variable with the name <varname>sqlca</varname> provides a global variable with the name <varname>sqlca</varname>
that has the following structure: that has the following structure:
<programlisting> <programlisting>
...@@ -1064,7 +1064,7 @@ struct ...@@ -1064,7 +1064,7 @@ struct
} sqlca; } sqlca;
</programlisting> </programlisting>
(In a multithreaded program, every thread automatically gets its (In a multithreaded program, every thread automatically gets its
own copy of <varname>sqlca</varname>. This works similar to the own copy of <varname>sqlca</varname>. This works similarly to the
handling of the standard C global variable handling of the standard C global variable
<varname>errno</varname>.) <varname>errno</varname>.)
</para> </para>
...@@ -1132,7 +1132,7 @@ struct ...@@ -1132,7 +1132,7 @@ struct
<para> <para>
The structure <varname>sqlca</varname> is not defined in the SQL The structure <varname>sqlca</varname> is not defined in the SQL
standard, but is implemented in several other SQL database standard, but is implemented in several other SQL database
systems. The definitions are similar in the core, but if you want systems. The definitions are similar at the core, but if you want
to write portable applications, then you should investigate the to write portable applications, then you should investigate the
different implementations carefully. different implementations carefully.
</para> </para>
...@@ -1539,7 +1539,7 @@ ecpg prog1.pgc ...@@ -1539,7 +1539,7 @@ ecpg prog1.pgc
<programlisting> <programlisting>
cc -c prog1.c cc -c prog1.c
</programlisting> </programlisting>
The generated C source files include headers files from the The generated C source files include header files from the
<productname>PostgreSQL</> installation, so if you installed <productname>PostgreSQL</> installation, so if you installed
<productname>PostgreSQL</> in a location that is not searched by <productname>PostgreSQL</> in a location that is not searched by
default, you have to add an option such as default, you have to add an option such as
...@@ -1575,9 +1575,9 @@ ECPG = ecpg ...@@ -1575,9 +1575,9 @@ ECPG = ecpg
</para> </para>
<para> <para>
<application>ecpg</application> is thread-safe if it is compiled using The <application>ecpg</application> library is thread-safe if it is built
the <option>--enable-thread-safety</> <filename>configure</filename> using the <option>--enable-thread-safety</> command-line option to
command-line option. (You might need to use other threading <filename>configure</filename>. (You might need to use other threading
command-line options to compile your client code.) command-line options to compile your client code.)
</para> </para>
</sect1> </sect1>
...@@ -1621,7 +1621,7 @@ ECPG = ecpg ...@@ -1621,7 +1621,7 @@ ECPG = ecpg
<title>Internals</title> <title>Internals</title>
<para> <para>
This section explain how <application>ECPG</application> works This section explains how <application>ECPG</application> works
internally. This information can occasionally be useful to help internally. This information can occasionally be useful to help
users understand how to use <application>ECPG</application>. users understand how to use <application>ECPG</application>.
</para> </para>
......
<!-- <!--
$PostgreSQL: pgsql/doc/src/sgml/external-projects.sgml,v 1.5 2004/12/13 18:05:08 petere Exp $ $PostgreSQL: pgsql/doc/src/sgml/external-projects.sgml,v 1.6 2004/12/28 22:47:15 tgl Exp $
--> -->
<chapter id="external-projects"> <chapter id="external-projects">
...@@ -9,15 +9,28 @@ $PostgreSQL: pgsql/doc/src/sgml/external-projects.sgml,v 1.5 2004/12/13 18:05:08 ...@@ -9,15 +9,28 @@ $PostgreSQL: pgsql/doc/src/sgml/external-projects.sgml,v 1.5 2004/12/13 18:05:08
<productname>PostgreSQL</productname> is a complex software project, <productname>PostgreSQL</productname> is a complex software project,
and managing it is difficult. We have found that many and managing it is difficult. We have found that many
enhancements to <productname>PostgreSQL</productname> can be more enhancements to <productname>PostgreSQL</productname> can be more
efficiently developed independently of the main project. They can efficiently developed separately from the core project. Separate
have their own developer teams, email lists, their own bug tracking, projects can
and their own release schedule. While their independence makes have their own developer teams, email lists, bug tracking,
development easier, it makes user's jobs harder. They have to hunt and release schedules. While their independence makes
development easier, it makes users' jobs harder. They have to hunt
around looking for database enhancements to meet their needs. around looking for database enhancements to meet their needs.
This section outlines some of the more popular externally This section describes some of the more popular externally
developed enhancements and guides you on how to find them. developed enhancements and guides you on how to find them.
</para> </para>
<para>
Many <productname>PostgreSQL</productname>-related projects are
hosted at either
<productname>GBorg</> at <ulink url="http://gborg.postgresql.org">
http://gborg.postgresql.org</ulink> or
<productname>pgFoundry</> at <ulink
url="http://pgfoundry.org">http://pgfoundry.org</ulink>.
There are other
<productname>PostgreSQL</productname>-related projects that are hosted
elsewhere, but you will have to do an Internet search to find them.
</para>
<sect1 id="interfaces"> <sect1 id="interfaces">
<title>Externally Developed Interfaces</title> <title>Externally Developed Interfaces</title>
...@@ -36,11 +49,7 @@ $PostgreSQL: pgsql/doc/src/sgml/external-projects.sgml,v 1.5 2004/12/13 18:05:08 ...@@ -36,11 +49,7 @@ $PostgreSQL: pgsql/doc/src/sgml/external-projects.sgml,v 1.5 2004/12/13 18:05:08
</para> </para>
<para> <para>
To use other interfaces, you have to do some searching. For example, Some of the more popular interfaces are:
<productname>GBorg</> at <ulink url="http://gborg.postgresql.org">
http://gborg.postgresql.org</ulink> has over thirty interfaces listed
in its <literal>Drivers/Interfaces</> section. Some of the more
popular interfaces are:
<variablelist> <variablelist>
<varlistentry> <varlistentry>
...@@ -54,20 +63,20 @@ $PostgreSQL: pgsql/doc/src/sgml/external-projects.sgml,v 1.5 2004/12/13 18:05:08 ...@@ -54,20 +63,20 @@ $PostgreSQL: pgsql/doc/src/sgml/external-projects.sgml,v 1.5 2004/12/13 18:05:08
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term>Npgsql</term> <term>pgjdbc</term>
<listitem> <listitem>
<para> <para>
<application>.Net</> interface for more recent A <application>JDBC</> interface.
<application>Windows</> applications.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term>libpq++</term> <term>Npgsql</term>
<listitem> <listitem>
<para> <para>
An older <application>C++</> interface. <application>.Net</> interface for more recent
<application>Windows</> applications.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
...@@ -82,57 +91,57 @@ $PostgreSQL: pgsql/doc/src/sgml/external-projects.sgml,v 1.5 2004/12/13 18:05:08 ...@@ -82,57 +91,57 @@ $PostgreSQL: pgsql/doc/src/sgml/external-projects.sgml,v 1.5 2004/12/13 18:05:08
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term>pgperl</term> <term>libpq++</term>
<listitem> <listitem>
<para> <para>
A <application>Perl</> interface with an <acronym>API</> similar An older <application>C++</> interface.
to <application>libpq</>.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term>DBD-Pg</term> <term>pgperl</term>
<listitem> <listitem>
<para> <para>
A <application>Perl</> interface that uses the A <application>Perl</> interface with an <acronym>API</> similar
<acronym>DBD</>-standard <application>API</>. to <application>libpq</>.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term>pgtcl</term> <term>DBD-Pg</term>
<listitem> <listitem>
<para> <para>
The original version of the <application>TCL</> interface. A <application>Perl</> interface that uses the
<acronym>DBD</>-standard <application>API</>.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term>PyGreSQL</term> <term>pgtclng</term>
<listitem> <listitem>
<para> <para>
A <application>Python</> interface library. A newer version of the <application>Tcl</> interface.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term>pgjdbc</term> <term>pgtcl</term>
<listitem> <listitem>
<para> <para>
A <application>JDBC</> interface. The original version of the <application>Tcl</> interface.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term>pgtclng</term> <term>PyGreSQL</term>
<listitem> <listitem>
<para> <para>
A newer version of the <application>TCL</> interface. A <application>Python</> interface library.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
...@@ -140,14 +149,6 @@ $PostgreSQL: pgsql/doc/src/sgml/external-projects.sgml,v 1.5 2004/12/13 18:05:08 ...@@ -140,14 +149,6 @@ $PostgreSQL: pgsql/doc/src/sgml/external-projects.sgml,v 1.5 2004/12/13 18:05:08
</variablelist> </variablelist>
</para> </para>
<para>
That section also contains several server-side languages that are
separate projects. <application>pgFoundry</> at <ulink
url="http://pgfoundry.org">http://pgfoundry.org</ulink> contains
even more projects. Other projects are not even hosted on these
servers and you will have to do an Internet search to find them.
</para>
</sect1> </sect1>
<sect1 id="extensions"> <sect1 id="extensions">
...@@ -169,7 +170,7 @@ $PostgreSQL: pgsql/doc/src/sgml/external-projects.sgml,v 1.5 2004/12/13 18:05:08 ...@@ -169,7 +170,7 @@ $PostgreSQL: pgsql/doc/src/sgml/external-projects.sgml,v 1.5 2004/12/13 18:05:08
like <application>PostGIS</>. Even <application>PostgreSQL</> like <application>PostGIS</>. Even <application>PostgreSQL</>
replication solutions are developed externally. For example, replication solutions are developed externally. For example,
<application>Slony-I</> is a popular master/slave replication solution <application>Slony-I</> is a popular master/slave replication solution
that is developed independently from the main projects. that is developed independently from the core project.
</para> </para>
<para> <para>
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/information_schema.sgml,v 1.19 2004/11/27 21:27:06 petere Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/information_schema.sgml,v 1.20 2004/12/28 22:47:15 tgl Exp $ -->
<chapter id="information-schema"> <chapter id="information-schema">
<title>The Information Schema</title> <title>The Information Schema</title>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
exists in all databases. The owner of this schema is the initial exists in all databases. The owner of this schema is the initial
database user in the cluster, and that user naturally has all the database user in the cluster, and that user naturally has all the
privileges on this schema, including the ability to drop it (but privileges on this schema, including the ability to drop it (but
the space savings achieved by this are minuscule). the space savings achieved by that are minuscule).
</para> </para>
<para> <para>
...@@ -1003,7 +1003,7 @@ ...@@ -1003,7 +1003,7 @@
function (as parameter or return type) and stores some information function (as parameter or return type) and stores some information
about how the data type is used in that instance (for example, the about how the data type is used in that instance (for example, the
declared maximum length, if applicable). Each data type declared maximum length, if applicable). Each data type
descriptors is assigned an arbitrary identifier that is unique descriptor is assigned an arbitrary identifier that is unique
among the data type descriptor identifiers assigned for one object among the data type descriptor identifiers assigned for one object
(table, domain, function). This view is probably not useful for (table, domain, function). This view is probably not useful for
applications, but it is used to define some other views in the applications, but it is used to define some other views in the
...@@ -1735,7 +1735,7 @@ ORDER BY c.ordinal_position; ...@@ -1735,7 +1735,7 @@ ORDER BY c.ordinal_position;
in the current database that are restricted by some unique, primary in the current database that are restricted by some unique, primary
key, or foreign key constraint. Check constraints are not included key, or foreign key constraint. Check constraints are not included
in this view. Only those columns are shown that are contained in a in this view. Only those columns are shown that are contained in a
table owned the current user. table owned by the current user.
</para> </para>
<table> <table>
...@@ -3320,7 +3320,7 @@ ORDER BY c.ordinal_position; ...@@ -3320,7 +3320,7 @@ ORDER BY c.ordinal_position;
<para> <para>
The table <literal>sql_packages</literal> contains information The table <literal>sql_packages</literal> contains information
about which features packages defined in the SQL standard are about which feature packages defined in the SQL standard are
supported by <productname>PostgreSQL</productname>. Refer to <xref supported by <productname>PostgreSQL</productname>. Refer to <xref
linkend="features"> for background information on feature packages. linkend="features"> for background information on feature packages.
</para> </para>
...@@ -3888,7 +3888,7 @@ ORDER BY c.ordinal_position; ...@@ -3888,7 +3888,7 @@ ORDER BY c.ordinal_position;
incompatibilities with the SQL standard that affect the incompatibilities with the SQL standard that affect the
representation in the information schema. First, trigger names are representation in the information schema. First, trigger names are
local to the table in <productname>PostgreSQL</productname>, rather local to the table in <productname>PostgreSQL</productname>, rather
than independent schema objects. Therefore there may be duplicate than being independent schema objects. Therefore there may be duplicate
trigger names defined in one schema, as long as they belong to trigger names defined in one schema, as long as they belong to
different tables. (<literal>trigger_catalog</literal> and different tables. (<literal>trigger_catalog</literal> and
<literal>trigger_schema</literal> are really the values pertaining <literal>trigger_schema</literal> are really the values pertaining
......
This diff is collapsed.
<!-- <!--
$PostgreSQL: pgsql/doc/src/sgml/lobj.sgml,v 1.33 2003/11/29 19:51:37 pgsql Exp $ $PostgreSQL: pgsql/doc/src/sgml/lobj.sgml,v 1.34 2004/12/28 22:47:15 tgl Exp $
--> -->
<chapter id="largeObjects"> <chapter id="largeObjects">
...@@ -9,15 +9,11 @@ $PostgreSQL: pgsql/doc/src/sgml/lobj.sgml,v 1.33 2003/11/29 19:51:37 pgsql Exp $ ...@@ -9,15 +9,11 @@ $PostgreSQL: pgsql/doc/src/sgml/lobj.sgml,v 1.33 2003/11/29 19:51:37 pgsql Exp $
<indexterm><primary>BLOB</><see>large object</></> <indexterm><primary>BLOB</><see>large object</></>
<para> <para>
In <productname>PostgreSQL</productname> releases prior to 7.1, <productname>PostgreSQL</productname> has a <firstterm>large object</>
the size of any row in the database could not exceed the size of a facility, which provides stream-style access to user data that is stored
data page. Since the size of a data page is 8192 bytes (the in a special large-object structure. Streaming access is useful
default, which can be raised up to 32768), the upper limit on the when working with data values that are too large to manipulate
size of a data value was relatively low. To support the storage of conveniently as a whole.
larger atomic values, <productname>PostgreSQL</productname>
provided and continues to provide a large object interface. This
interface provides file-oriented access to user data that is stored in
a special large-object structure.
</para> </para>
<para> <para>
...@@ -59,10 +55,13 @@ $PostgreSQL: pgsql/doc/src/sgml/lobj.sgml,v 1.33 2003/11/29 19:51:37 pgsql Exp $ ...@@ -59,10 +55,13 @@ $PostgreSQL: pgsql/doc/src/sgml/lobj.sgml,v 1.33 2003/11/29 19:51:37 pgsql Exp $
<indexterm><primary>sliced bread</><see>TOAST</></indexterm> <indexterm><primary>sliced bread</><see>TOAST</></indexterm>
<productname>PostgreSQL 7.1</productname> introduced a mechanism <productname>PostgreSQL 7.1</productname> introduced a mechanism
(nicknamed <quote><acronym>TOAST</acronym></quote>) that allows (nicknamed <quote><acronym>TOAST</acronym></quote>) that allows
data rows to be much larger than individual data pages. This data values to be much larger than single pages. This
makes the large object interface partially obsolete. One makes the large object facility partially obsolete. One
remaining advantage of the large object interface is that it allows values up remaining advantage of the large object facility is that it allows values
to 2 GB in size, whereas <acronym>TOAST</acronym> can only handle 1 GB. up to 2 GB in size, whereas <acronym>TOAST</acronym>ed fields can be at
most 1 GB. Also, large objects can be manipulated piece-by-piece much more
easily than ordinary data fields, so the practical limits are considerably
different.
</para> </para>
</sect1> </sect1>
...@@ -117,7 +116,7 @@ Oid lo_creat(PGconn *conn, int mode); ...@@ -117,7 +116,7 @@ Oid lo_creat(PGconn *conn, int mode);
creates a new large object. creates a new large object.
<replaceable class="parameter">mode</replaceable> is a bit mask <replaceable class="parameter">mode</replaceable> is a bit mask
describing several different attributes of the new describing several different attributes of the new
object. The symbolic constants listed here are defined object. The symbolic constants used here are defined
in the header file <filename>libpq/libpq-fs.h</filename>. in the header file <filename>libpq/libpq-fs.h</filename>.
The access type (read, write, or both) is controlled by The access type (read, write, or both) is controlled by
or'ing together the bits <symbol>INV_READ</symbol> and or'ing together the bits <symbol>INV_READ</symbol> and
...@@ -149,6 +148,9 @@ Oid lo_import(PGconn *conn, const char *filename); ...@@ -149,6 +148,9 @@ Oid lo_import(PGconn *conn, const char *filename);
specifies the operating system name of specifies the operating system name of
the file to be imported as a large object. the file to be imported as a large object.
The return value is the OID that was assigned to the new large object. The return value is the OID that was assigned to the new large object.
Note that the file is read by the client interface library, not by
the server; so it must exist in the client filesystem and be readable
by the client application.
</para> </para>
</sect2> </sect2>
...@@ -164,7 +166,9 @@ int lo_export(PGconn *conn, Oid lobjId, const char *filename); ...@@ -164,7 +166,9 @@ int lo_export(PGconn *conn, Oid lobjId, const char *filename);
<indexterm><primary>lo_export</></> <indexterm><primary>lo_export</></>
The <parameter>lobjId</parameter> argument specifies the OID of the large The <parameter>lobjId</parameter> argument specifies the OID of the large
object to export and the <parameter>filename</parameter> argument specifies object to export and the <parameter>filename</parameter> argument specifies
the operating system name name of the file. the operating system name of the file.
Note that the file is written by the client interface library, not by
the server.
</para> </para>
</sect2> </sect2>
...@@ -200,7 +204,7 @@ int lo_write(PGconn *conn, int fd, const char *buf, size_t len); ...@@ -200,7 +204,7 @@ int lo_write(PGconn *conn, int fd, const char *buf, size_t len);
</synopsis> </synopsis>
<indexterm><primary>lo_write</></> writes <indexterm><primary>lo_write</></> writes
<parameter>len</parameter> bytes from <parameter>buf</parameter> <parameter>len</parameter> bytes from <parameter>buf</parameter>
to large object <parameter>fd</>. The <parameter>fd</parameter> to large object descriptor <parameter>fd</>. The <parameter>fd</parameter>
argument must have been returned by a previous argument must have been returned by a previous
<function>lo_open</function>. The number of bytes actually <function>lo_open</function>. The number of bytes actually
written is returned. In the event of an error, the return value written is returned. In the event of an error, the return value
...@@ -217,7 +221,7 @@ int lo_write(PGconn *conn, int fd, const char *buf, size_t len); ...@@ -217,7 +221,7 @@ int lo_write(PGconn *conn, int fd, const char *buf, size_t len);
int lo_read(PGconn *conn, int fd, char *buf, size_t len); int lo_read(PGconn *conn, int fd, char *buf, size_t len);
</synopsis> </synopsis>
<indexterm><primary>lo_read</></> reads <indexterm><primary>lo_read</></> reads
<parameter>len</parameter> bytes from large object <parameter>len</parameter> bytes from large object descriptor
<parameter>fd</parameter> into <parameter>buf</parameter>. The <parameter>fd</parameter> into <parameter>buf</parameter>. The
<parameter>fd</parameter> argument must have been returned by a <parameter>fd</parameter> argument must have been returned by a
previous <function>lo_open</function>. The number of bytes previous <function>lo_open</function>. The number of bytes
...@@ -227,16 +231,16 @@ int lo_read(PGconn *conn, int fd, char *buf, size_t len); ...@@ -227,16 +231,16 @@ int lo_read(PGconn *conn, int fd, char *buf, size_t len);
</sect2> </sect2>
<sect2> <sect2>
<title>Seeking on a Large Object</title> <title>Seeking in a Large Object</title>
<para> <para>
To change the current read or write location on a large To change the current read or write location associated with a
object, call large object descriptor, call
<synopsis> <synopsis>
int lo_lseek(PGconn *conn, int fd, int offset, int whence); int lo_lseek(PGconn *conn, int fd, int offset, int whence);
</synopsis> </synopsis>
<indexterm><primary>lo_lseek</></> This function moves the <indexterm><primary>lo_lseek</></> This function moves the
current location pointer for the large object described by current location pointer for the large object descriptor identified by
<parameter>fd</> to the new location specified by <parameter>fd</> to the new location specified by
<parameter>offset</>. The valid values for <parameter>whence</> <parameter>offset</>. The valid values for <parameter>whence</>
are <symbol>SEEK_SET</> (seek from object start), are <symbol>SEEK_SET</> (seek from object start),
...@@ -250,7 +254,7 @@ int lo_lseek(PGconn *conn, int fd, int offset, int whence); ...@@ -250,7 +254,7 @@ int lo_lseek(PGconn *conn, int fd, int offset, int whence);
<title>Obtaining the Seek Position of a Large Object</title> <title>Obtaining the Seek Position of a Large Object</title>
<para> <para>
To obtain the current read or write location of a large object, To obtain the current read or write location of a large object descriptor,
call call
<synopsis> <synopsis>
int lo_tell(PGconn *conn, int fd); int lo_tell(PGconn *conn, int fd);
...@@ -264,7 +268,7 @@ int lo_tell(PGconn *conn, int fd); ...@@ -264,7 +268,7 @@ int lo_tell(PGconn *conn, int fd);
<title>Closing a Large Object Descriptor</title> <title>Closing a Large Object Descriptor</title>
<para> <para>
A large object may be closed by calling A large object descriptor may be closed by calling
<synopsis> <synopsis>
int lo_close(PGconn *conn, int fd); int lo_close(PGconn *conn, int fd);
</synopsis> </synopsis>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment