Skip to content

Commit 8787bf8

Browse files
authored
Merge pull request #424 from chegong18/master
update the gist.sgml and libpg.sgml
2 parents 1e4f026 + 57b917c commit 8787bf8

File tree

11 files changed

+9305
-1852
lines changed

11 files changed

+9305
-1852
lines changed

postgresql/doc/src/sgml/ecpg.sgml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13398,7 +13398,7 @@ ____________________________________________________________________________-->
1339813398

1339913399
<!--==========================orignal english content==========================
1340013400
<para>
13401-
In typical usage, the <replaceable>string</replaceable> is a host
13401+
In typical usage, the <replaceable>string</replaceable> is a host
1340213402
variable reference to a string containing a dynamically-constructed
1340313403
SQL statement. The case of a literal string is not very useful;
1340413404
you might as well just write the SQL statement directly, without
@@ -18004,7 +18004,7 @@ ____________________________________________________________________________-->
1800418004
<term><literal>ECPG_INFORMIX_DIVIDE_ZERO</literal></term>
1800518005
<listitem>
1800618006
<para>
18007-
如果发现尝试除零,函数会返回这个值。在内部它被定义为 -1202(<productname>Informix</productname>定义)。
18007+
如果发现尝试除零,函数会返回这个值。在内部它被定义为 -1202(<productname>Informix</productname>定义)。
1800818008
</para>
1800918009
</listitem>
1801018010
</varlistentry>

postgresql/doc/src/sgml/fdwhandler.sgml

Lines changed: 490 additions & 61 deletions
Large diffs are not rendered by default.

postgresql/doc/src/sgml/func.sgml

Lines changed: 2956 additions & 719 deletions
Large diffs are not rendered by default.

postgresql/doc/src/sgml/gist.sgml

Lines changed: 643 additions & 292 deletions
Large diffs are not rendered by default.

postgresql/doc/src/sgml/information_schema.sgml

Lines changed: 888 additions & 6 deletions
Large diffs are not rendered by default.

postgresql/doc/src/sgml/libpq.sgml

Lines changed: 1740 additions & 315 deletions
Large diffs are not rendered by default.

postgresql/doc/src/sgml/logicaldecoding.sgml

Lines changed: 1096 additions & 67 deletions
Large diffs are not rendered by default.

postgresql/doc/src/sgml/monitoring.sgml

Lines changed: 1466 additions & 271 deletions
Large diffs are not rendered by default.

postgresql/doc/src/sgml/pageinspect.sgml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ ____________________________________________________________________________-->
544544
index's metapage. For example:
545545
<screen>
546546
test=# SELECT * FROM bt_metap('pg_cast_oid_index');
547-
-[ RECORD 1 ]-------------+-------
547+
-[ RECORD 1 ]-&minus;-&minus;-&minus;-&minus;-&minus;-+-&minus;-&minus;-&minus;-
548548
magic | 340322
549549
version | 4
550550
root | 1
@@ -599,7 +599,7 @@ ____________________________________________________________________________-->
599599
single pages of B-tree indexes. For example:
600600
<screen>
601601
test=# SELECT * FROM bt_page_stats('pg_cast_oid_index', 1);
602-
-[ RECORD 1 ]-+-----
602+
-[ RECORD 1 ]-+-&minus;-&minus;-
603603
blkno | 1
604604
type | l
605605
live_items | 224
@@ -1599,4 +1599,4 @@ mapp | {65}
15991599
</variablelist>
16001600
</sect2>
16011601

1602-
</sect1>
1602+
</sect1>

postgresql/doc/src/sgml/plhandler.sgml

Lines changed: 6 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -136,119 +136,15 @@ ____________________________________________________________________________-->
136136

137137
<!--==========================orignal english content==========================
138138
<para>
139-
This is a template for a procedural-language handler written in C:
140-
<programlisting>
141-
#include "postgres.h"
142-
#include "executor/spi.h"
143-
#include "commands/trigger.h"
144-
#include "fmgr.h"
145-
#include "access/heapam.h"
146-
#include "utils/syscache.h"
147-
#include "catalog/pg_proc.h"
148-
#include "catalog/pg_type.h"
149-
150-
PG_MODULE_MAGIC;
151-
152-
PG_FUNCTION_INFO_V1(plsample_call_handler);
153-
154-
Datum
155-
plsample_call_handler(PG_FUNCTION_ARGS)
156-
{
157-
Datum retval;
158-
159-
if (CALLED_AS_TRIGGER(fcinfo))
160-
{
161-
/*
162-
* Called as a trigger function
163-
*/
164-
TriggerData *trigdata = (TriggerData *) fcinfo-&gt;context;
165-
166-
retval = ...
167-
}
168-
else
169-
{
170-
/*
171-
* Called as a function
172-
*/
173-
174-
retval = ...
175-
}
176-
177-
return retval;
178-
}
179-
</programlisting>
180-
Only a few thousand lines of code have to be added instead of the
181-
dots to complete the call handler.
182-
</para>
183-
____________________________________________________________________________-->
184-
<para>
185-
这是一个用 C 编写的过程语言处理器的模板:
186-
<programlisting>
187-
#include "postgres.h"
188-
#include "executor/spi.h"
189-
#include "commands/trigger.h"
190-
#include "fmgr.h"
191-
#include "access/heapam.h"
192-
#include "utils/syscache.h"
193-
#include "catalog/pg_proc.h"
194-
#include "catalog/pg_type.h"
195-
196-
PG_MODULE_MAGIC;
197-
198-
PG_FUNCTION_INFO_V1(plsample_call_handler);
199-
200-
Datum
201-
plsample_call_handler(PG_FUNCTION_ARGS)
202-
{
203-
Datum retval;
204-
205-
if (CALLED_AS_TRIGGER(fcinfo))
206-
{
207-
/*
208-
* Called as a trigger function
209-
*/
210-
TriggerData *trigdata = (TriggerData *) fcinfo-&gt;context;
211-
212-
retval = ...
213-
}
214-
else
215-
{
216-
/*
217-
* Called as a function
218-
*/
219-
220-
retval = ...
221-
}
222-
223-
return retval;
224-
}
225-
</programlisting>
226-
要完成该调用处理器,只需要加入几千行代码来替代点号即可。
227-
</para>
228-
229-
<!--==========================orignal english content==========================
230-
<para>
231-
After having compiled the handler function into a loadable module
232-
(see <xref linkend="dfunc"/>), the following commands then
233-
register the sample procedural language:
234-
<programlisting>
235-
CREATE FUNCTION plsample_call_handler() RETURNS language_handler
236-
AS '<replaceable>filename</replaceable>'
237-
LANGUAGE C;
238-
CREATE LANGUAGE plsample
239-
HANDLER plsample_call_handler;
240-
</programlisting>
139+
A template for a procedural-language handler written as a C extension is
140+
provided in <literal>src/test/modules/plsample</literal>. This is a
141+
working sample demonstrating one way to create a procedural-language
142+
handler, process parameters, and return a value.
241143
</para>
242144
____________________________________________________________________________-->
243145
<para>
244-
在将处理器函数编译成一个可载入模块(<xref linkend="dfunc"/>)后,接着用下列命令注册例子过程语言:
245-
<programlisting>
246-
CREATE FUNCTION plsample_call_handler() RETURNS language_handler
247-
AS '<replaceable>filename</replaceable>'
248-
LANGUAGE C;
249-
CREATE LANGUAGE plsample
250-
HANDLER plsample_call_handler;
251-
</programlisting>
146+
编写为C扩展的过程-语言处理程序的模板,在<literal>src/test/modules/plsample</literal>中提供。
147+
这是一个工作示例,演示了一种方法,以创建过程语言处理程序、处理参数以及返回一个值。
252148
</para>
253149

254150
<!--==========================orignal english content==========================

0 commit comments

Comments
 (0)