提交 3b0453b2 编写于 作者: N Neil Conway

Various documentation improvements. Add a lot of index entries for

the builtin functions (although some more entries are still needed),
and remove the duplicate index entries that have been causing
collateindex.pl warnings. Consistently use "int" and "bigint", rather
than a mix of "int", "integer", "int4", "bigint", and "int8". Make
parenthesis style in syntax examples more consistent. Various
copy-editing for newly-added documentation and SGML markup fixes.
上级 08dc2af9
<!--
$PostgreSQL: pgsql/doc/src/sgml/dfunc.sgml,v 1.31 2005/04/09 03:52:43 momjian Exp $
$PostgreSQL: pgsql/doc/src/sgml/dfunc.sgml,v 1.32 2005/09/14 21:14:26 neilc Exp $
-->
<sect2 id="dfunc">
......@@ -28,11 +28,10 @@ $PostgreSQL: pgsql/doc/src/sgml/dfunc.sgml,v 1.31 2005/04/09 03:52:43 momjian Ex
</para>
<para>
<indexterm><primary>PIC</></> Creating shared libraries is generally
analogous to linking executables: first the source files are
compiled into object files, then the object files are linked
together. The object files need to be created as
<firstterm>position-independent code</firstterm>
Creating shared libraries is generally analogous to linking
executables: first the source files are compiled into object files,
then the object files are linked together. The object files need to
be created as <firstterm>position-independent code</firstterm>
(<acronym>PIC</acronym>),<indexterm><primary>PIC</></> which
conceptually means that they can be placed at an arbitrary location
in memory when they are loaded by the executable. (Object files
......
此差异已折叠。
<!--
$PostgreSQL: pgsql/doc/src/sgml/plpgsql.sgml,v 1.75 2005/07/02 08:59:47 neilc Exp $
$PostgreSQL: pgsql/doc/src/sgml/plpgsql.sgml,v 1.76 2005/09/14 21:14:26 neilc Exp $
-->
<chapter id="plpgsql">
......@@ -1320,20 +1320,27 @@ EXECUTE 'UPDATE tbl SET '
</programlisting>
</para>
<indexterm>
<primary>quote_ident</primary>
<secondary>use in PL/PgSQL</secondary>
</indexterm>
<indexterm>
<primary>quote_literal</primary>
<secondary>use in PL/PgSQL</secondary>
</indexterm>
<para>
This example shows use of the functions
<function>quote_ident(<type>text</type>)</function> and
<function>quote_literal(<type>text</type>)</function>.<indexterm><primary>quote_ident</><secondary>use
in
PL/pgSQL</></indexterm><indexterm><primary>quote_literal</><secondary>use
in PL/pgSQL</></indexterm> For safety, variables containing column and
table identifiers should be passed to function
<function>quote_ident</function>. Variables containing values
that should be literal strings in the constructed command should
be passed to <function>quote_literal</function>. Both take the
appropriate steps to return the input text enclosed in double or
single quotes respectively, with any embedded special characters
properly escaped.
This example demonstrates the use of the
<function>quote_ident</function> and
<function>quote_literal</function> functions. For safety,
expressions containing column and table identifiers should be
passed to <function>quote_ident</function>. Expressions containing
values that should be literal strings in the constructed command
should be passed to <function>quote_literal</function>. Both
take the appropriate steps to return the input text enclosed in
double or single quotes respectively, with any embedded special
characters properly escaped.
</para>
<para>
......@@ -3599,11 +3606,11 @@ $$ LANGUAGE plpgsql;
The <application>PL/pgSQL</> version of
<command>EXECUTE</command> works similarly to the
<application>PL/SQL</> version, but you have to remember to use
<function>quote_literal(text)</function> and
<function>quote_string(text)</function> as described in <xref
<function>quote_literal</function> and
<function>quote_ident</function> as described in <xref
linkend="plpgsql-statements-executing-dyn">. Constructs of the
type <literal>EXECUTE 'SELECT * FROM $1';</literal> will not
work unless you use these functions.
type <literal>EXECUTE 'SELECT * FROM $1';</literal> will not work
unless you use these functions.
</para>
</sect3>
......
<!--
$PostgreSQL: pgsql/doc/src/sgml/xfunc.sgml,v 1.103 2005/05/30 23:09:07 tgl Exp $
$PostgreSQL: pgsql/doc/src/sgml/xfunc.sgml,v 1.104 2005/09/14 21:14:26 neilc Exp $
-->
<sect1 id="xfunc">
......@@ -99,9 +99,8 @@ $PostgreSQL: pgsql/doc/src/sgml/xfunc.sgml,v 1.103 2005/05/30 23:09:07 tgl Exp $
<indexterm><primary>SETOF</><seealso>function</></> Alternatively,
an SQL function may be declared to return a set, by specifying the
function's return type as <literal>SETOF
<replaceable>sometype</></literal>.<indexterm><primary>SETOF</></>
In this case all rows of the last query's result are returned.
Further details appear below.
<replaceable>sometype</></literal>. In this case all rows of the
last query's result are returned. Further details appear below.
</para>
<para>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册