Skip to content

Commit 9454ea9

Browse files
authored
Merge pull request #338 from chegong18/master
pull up glossary,HA,history and hstore.sgml
2 parents f6f4c11 + 97bf018 commit 9454ea9

File tree

13 files changed

+5629
-3936
lines changed

13 files changed

+5629
-3936
lines changed

postgresql/doc/src/sgml/glossary.sgml

Lines changed: 1080 additions & 1 deletion
Large diffs are not rendered by default.

postgresql/doc/src/sgml/high-availability.sgml

Lines changed: 149 additions & 128 deletions
Large diffs are not rendered by default.

postgresql/doc/src/sgml/history.sgml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ ____________________________________________________________________________-->
162162
and trimmed in size by 25%. Many internal changes improved
163163
performance and
164164
maintainability. <productname>Postgres95</productname> release
165-
1.0.x ran about 30-50% faster on the Wisconsin Benchmark compared
165+
1.0.x ran about 30&ndash;50% faster on the Wisconsin Benchmark compared
166166
to <productname>POSTGRES</productname>, Version 4.2. Apart from
167167
bug fixes, the following were the major enhancements:
168168

postgresql/doc/src/sgml/hstore.sgml

Lines changed: 1242 additions & 666 deletions
Large diffs are not rendered by default.

postgresql/doc/src/sgml/libpq.sgml

Lines changed: 1730 additions & 2270 deletions
Large diffs are not rendered by default.

postgresql/doc/src/sgml/lo.sgml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,17 @@ ____________________________________________________________________________-->
2626
<filename>lo</filename>模块提供管理大对象(也被称为 LO 或 BLOB)的支持。这包括一种数据类型<type>lo</type>以及一个触发器<function>lo_manage</function>。
2727
</para>
2828

29+
<!--==========================orignal english content==========================
30+
<para>
31+
This module is considered <quote>trusted</quote>, that is, it can be
32+
installed by non-superusers who have <literal>CREATE</literal> privilege
33+
on the current database.
34+
</para>
35+
____________________________________________________________________________-->
36+
<para>
37+
这个模块被视为<quote>trusted</quote>,也就是说,它能够由当前数据库中具有<literal>CREATE</literal>特权的非超级用户来安装。
38+
</para>
39+
2940
<sect2>
3041
<!--==========================orignal english content==========================
3142
<title>Rationale</title>

postgresql/doc/src/sgml/lobj.sgml

Lines changed: 160 additions & 135 deletions
Original file line numberDiff line numberDiff line change
@@ -191,11 +191,12 @@ ____________________________________________________________________________-->
191191
If an error occurs while executing any one of these functions, the
192192
function will return an otherwise-impossible value, typically 0 or -1.
193193
A message describing the error is stored in the connection object and
194-
can be retrieved with <function>PQerrorMessage</function>.
194+
can be retrieved with <xref linkend="libpq-PQerrorMessage"/>.
195195
</para>
196196
____________________________________________________________________________-->
197197
<para>
198-
在执行任何一个这种函数期间如果发生一个错误,该函数将会返回一个其他的不可能值,典型的是0或-1。一个关于该错误的消息亦会被保存在连接对象中,可以通过<function>PQerrorMessage</function>检索到。
198+
在执行任何一个这种函数期间如果发生一个错误,该函数将会返回一个其他的不可能值,典型的是0或-1。
199+
一个关于该错误的消息亦会被保存在连接对象中,可以通过<xref linkend="libpq-PQerrorMessage"/>检索到。
199200
</para>
200201

201202
<!--==========================orignal english content==========================
@@ -913,130 +914,153 @@ ____________________________________________________________________________-->
913914
<xref linkend="lo-funcs-table"/>中列出了为从 SQL 操纵大对象定制的服务器端函数。
914915
</para>
915916

916-
<table id="lo-funcs-table">
917-
<!--==========================orignal english content==========================
918-
<title>SQL-Oriented Large Object Functions</title>
919-
____________________________________________________________________________-->
920-
<title>面向 SQL 的大对象函数</title>
921-
<tgroup cols="5">
922-
<thead>
923-
<!--==========================orignal english content==========================
924-
<row>
925-
<entry>Function</entry>
926-
<entry>Return Type</entry>
927-
<entry>Description</entry>
928-
<entry>Example</entry>
929-
<entry>Result</entry>
930-
</row>
931-
____________________________________________________________________________-->
932-
<row>
933-
<entry>函数</entry>
934-
<entry>返回类型</entry>
935-
<entry>描述</entry>
936-
<entry>实例</entry>
937-
<entry>结果</entry>
938-
</row>
939-
</thead>
940-
941-
<tbody>
942-
<!--==========================orignal english content==========================
943-
<row>
944-
<entry>
945-
<indexterm>
946-
<primary>lo_from_bytea</primary>
947-
</indexterm>
948-
<literal><function>lo_from_bytea(<parameter>loid</parameter> <type>oid</type>, <parameter>string</parameter> <type>bytea</type>)</function></literal>
949-
</entry>
950-
<entry><type>oid</type></entry>
951-
<entry>
952-
Create a large object and store data there, returning its OID.
953-
Pass <literal>0</literal> to have the system choose an OID.
954-
</entry>
955-
<entry><literal>lo_from_bytea(0, '\xffffff00')</literal></entry>
956-
<entry><literal>24528</literal></entry>
957-
</row>
958-
____________________________________________________________________________-->
959-
<row>
960-
<entry>
961-
<indexterm>
962-
<primary>lo_from_bytea</primary>
963-
</indexterm>
964-
<literal><function>lo_from_bytea(<parameter>loid</parameter> <type>oid</type>, <parameter>string</parameter> <type>bytea</type>)</function></literal>
965-
</entry>
966-
<entry><type>oid</type></entry>
967-
<entry>
968-
创建一个大对象并且在其中存储数据,返回它的 OID。
969-
传递<literal>0</literal>会让系统选择一个 OID。
970-
</entry>
971-
<entry><literal>lo_from_bytea(0, '\xffffff00')</literal></entry>
972-
<entry><literal>24528</literal></entry>
973-
</row>
974-
975-
<!--==========================orignal english content==========================
976-
<row>
977-
<entry>
978-
<indexterm>
979-
<primary>lo_put</primary>
980-
</indexterm>
981-
<literal><function>lo_put(<parameter>loid</parameter> <type>oid</type>, <parameter>offset</parameter> <type>bigint</type>, <parameter>str</parameter> <type>bytea</type>)</function></literal>
982-
</entry>
983-
<entry><type>void</type></entry>
984-
<entry>
985-
Write data at the given offset.
986-
</entry>
987-
<entry><literal>lo_put(24528, 1, '\xaa')</literal></entry>
988-
<entry></entry>
989-
</row>
990-
____________________________________________________________________________-->
991-
<row>
992-
<entry>
993-
<indexterm>
994-
<primary>lo_put</primary>
995-
</indexterm>
996-
<literal><function>lo_put(<parameter>loid</parameter> <type>oid</type>, <parameter>offset</parameter> <type>bigint</type>, <parameter>str</parameter> <type>bytea</type>)</function></literal>
997-
</entry>
998-
<entry><type>void</type></entry>
999-
<entry>
1000-
在给定的偏移位置写入数据。
1001-
</entry>
1002-
<entry><literal>lo_put(24528, 1, '\xaa')</literal></entry>
1003-
<entry></entry>
1004-
</row>
1005-
1006-
<!--==========================orignal english content==========================
1007-
<row>
1008-
<entry>
1009-
<indexterm>
1010-
<primary>lo_get</primary>
1011-
</indexterm>
1012-
<literal><function>lo_get(<parameter>loid</parameter> <type>oid</type> <optional>, <parameter>from</parameter> <type>bigint</type>, <parameter>for</parameter> <type>int</type></optional>)</function></literal>
1013-
</entry>
1014-
<entry><type>bytea</type></entry>
1015-
<entry>
1016-
Extract contents or a substring thereof.
1017-
</entry>
1018-
<entry><literal>lo_get(24528, 0, 3)</literal></entry>
1019-
<entry><literal>\xffaaff</literal></entry>
1020-
</row>
1021-
____________________________________________________________________________-->
1022-
<row>
1023-
<entry>
1024-
<indexterm>
1025-
<primary>lo_get</primary>
1026-
</indexterm>
1027-
<literal><function>lo_get(<parameter>loid</parameter> <type>oid</type> <optional>, <parameter>from</parameter> <type>bigint</type>, <parameter>for</parameter> <type>int</type></optional>)</function></literal>
1028-
</entry>
1029-
<entry><type>bytea</type></entry>
1030-
<entry>
1031-
在其中抽取内容或一个子串。
1032-
</entry>
1033-
<entry><literal>lo_get(24528, 0, 3)</literal></entry>
1034-
<entry><literal>\xffaaff</literal></entry>
1035-
</row>
1036-
1037-
</tbody>
1038-
</tgroup>
1039-
</table>
917+
<table id="lo-funcs-table">
918+
<!--==========================orignal english content==========================
919+
<title>SQL-Oriented Large Object Functions</title>
920+
____________________________________________________________________________-->
921+
<title>面向 SQL 的大对象函数</title>
922+
<tgroup cols="1">
923+
<thead>
924+
<!--==========================orignal english content==========================
925+
<row>
926+
<entry role="func_table_entry"><para role="func_signature">
927+
Function
928+
</para>
929+
<para>
930+
Description
931+
</para>
932+
<para>
933+
Example(s)
934+
</para></entry>
935+
</row>
936+
____________________________________________________________________________-->
937+
<row>
938+
<entry role="func_table_entry"><para role="func_signature">
939+
函数
940+
</para>
941+
<para>
942+
描述
943+
</para>
944+
<para>
945+
例子
946+
</para></entry>
947+
</row>
948+
</thead>
949+
950+
<tbody>
951+
<!--==========================orignal english content==========================
952+
<row>
953+
<entry role="func_table_entry"><para role="func_signature">
954+
<indexterm>
955+
<primary>lo_from_bytea</primary>
956+
</indexterm>
957+
<function>lo_from_bytea</function> ( <parameter>loid</parameter> <type>oid</type>, <parameter>data</parameter> <type>bytea</type> )
958+
<returnvalue>oid</returnvalue>
959+
</para>
960+
<para>
961+
Creates a large object and stores <parameter>data</parameter> in it.
962+
If <parameter>loid</parameter> is zero then the system will choose a
963+
free OID, otherwise that OID is used (with an error if some large
964+
object already has that OID). On success, the large object's OID is
965+
returned.
966+
</para>
967+
<para>
968+
<literal>lo_from_bytea(0, '\xffffff00')</literal>
969+
<returnvalue>24528</returnvalue>
970+
</para></entry>
971+
</row>
972+
____________________________________________________________________________-->
973+
<row>
974+
<entry role="func_table_entry"><para role="func_signature">
975+
<indexterm>
976+
<primary>lo_from_bytea</primary>
977+
</indexterm>
978+
<function>lo_from_bytea</function> ( <parameter>loid</parameter> <type>oid</type>, <parameter>data</parameter> <type>bytea</type> )
979+
<returnvalue>oid</returnvalue>
980+
</para>
981+
<para>
982+
创建一个大对象并在其中存储<parameter>数据</parameter>。
983+
如果<parameter>loid</parameter>为0,则系统将选择一个空闲OID,否则该OID已被使用(如果某个大对象已经拥有该OID,则会出现错误)。在成功时,将返回大对象的OID。
984+
</para>
985+
<para>
986+
<literal>lo_from_bytea(0, '\xffffff00')</literal>
987+
<returnvalue>24528</returnvalue>
988+
</para></entry>
989+
</row>
990+
991+
<!--==========================orignal english content==========================
992+
<row>
993+
<entry role="func_table_entry"><para role="func_signature">
994+
<indexterm>
995+
<primary>lo_put</primary>
996+
</indexterm>
997+
<function>lo_put</function> ( <parameter>loid</parameter> <type>oid</type>, <parameter>offset</parameter> <type>bigint</type>, <parameter>data</parameter> <type>bytea</type> )
998+
<returnvalue>void</returnvalue>
999+
</para>
1000+
<para>
1001+
Writes <parameter>data</parameter> starting at the given offset within
1002+
the large object; the large object is enlarged if necessary.
1003+
</para>
1004+
<para>
1005+
<literal>lo_put(24528, 1, '\xaa')</literal>
1006+
<returnvalue></returnvalue>
1007+
</para></entry>
1008+
</row>
1009+
____________________________________________________________________________-->
1010+
<row>
1011+
<entry role="func_table_entry"><para role="func_signature">
1012+
<indexterm>
1013+
<primary>lo_put</primary>
1014+
</indexterm>
1015+
<function>lo_put</function> ( <parameter>loid</parameter> <type>oid</type>, <parameter>offset</parameter> <type>bigint</type>, <parameter>data</parameter> <type>bytea</type> )
1016+
<returnvalue>void</returnvalue>
1017+
</para>
1018+
<para>
1019+
在大对象中写入从给定偏移量开始的<parameter>数据</parameter>;如有必要,可以把大对象扩大。
1020+
</para>
1021+
<para>
1022+
<literal>lo_put(24528, 1, '\xaa')</literal>
1023+
<returnvalue></returnvalue>
1024+
</para></entry>
1025+
</row>
1026+
1027+
<!--==========================orignal english content==========================
1028+
<row>
1029+
<entry role="func_table_entry"><para role="func_signature">
1030+
<indexterm>
1031+
<primary>lo_get</primary>
1032+
</indexterm>
1033+
<function>lo_get</function> ( <parameter>loid</parameter> <type>oid</type> <optional>, <parameter>offset</parameter> <type>bigint</type>, <parameter>length</parameter> <type>integer</type> </optional> )
1034+
<returnvalue>bytea</returnvalue>
1035+
</para>
1036+
<para>
1037+
Extracts the large object's contents, or a substring thereof.
1038+
</para>
1039+
<para>
1040+
<literal>lo_get(24528, 0, 3)</literal>
1041+
<returnvalue>\xffaaff</returnvalue>
1042+
</para></entry>
1043+
</row>
1044+
____________________________________________________________________________-->
1045+
<row>
1046+
<entry role="func_table_entry"><para role="func_signature">
1047+
<indexterm>
1048+
<primary>lo_get</primary>
1049+
</indexterm>
1050+
<function>lo_get</function> ( <parameter>loid</parameter> <type>oid</type> <optional>, <parameter>offset</parameter> <type>bigint</type>, <parameter>length</parameter> <type>integer</type> </optional> )
1051+
<returnvalue>bytea</returnvalue>
1052+
</para>
1053+
<para>
1054+
提取大对象的内容,或在其中的子字符串。
1055+
</para>
1056+
<para>
1057+
<literal>lo_get(24528, 0, 3)</literal>
1058+
<returnvalue>\xffaaff</returnvalue>
1059+
</para></entry>
1060+
</row>
1061+
</tbody>
1062+
</tgroup>
1063+
</table>
10401064

10411065
<!--==========================orignal english content==========================
10421066
<para>
@@ -1194,19 +1218,19 @@ ____________________________________________________________________________-->
11941218
<title>用<application>libpq</application>操作大对象的例子程序</title>
11951219
<!--==========================orignal english content==========================
11961220
<programlisting><![CDATA[
1197-
/*-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-
1221+
/*-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-
11981222
*
11991223
* testlo.c
12001224
* test using large objects with libpq
12011225
*
1202-
* Portions Copyright (c) 1996-2019, PostgreSQL Global Development Group
1226+
* Portions Copyright (c) 1996-2020, PostgreSQL Global Development Group
12031227
* Portions Copyright (c) 1994, Regents of the University of California
12041228
*
12051229
*
12061230
* IDENTIFICATION
12071231
* src/test/examples/testlo.c
12081232
*
1209-
*-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-
1233+
*-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-&minus;-
12101234
*/
12111235
#include <stdio.h>
12121236
#include <stdlib.h>
@@ -1471,19 +1495,19 @@ main(int argc, char **argv)
14711495
</programlisting>
14721496
____________________________________________________________________________-->
14731497
<programlisting><![CDATA[
1474-
/*-------------------------------------------------------------------------
1498+
/*-----------------------------------------------------------------
14751499
*
14761500
* testlo.c
1477-
* 测试通过 libpq 使用大对象
1501+
* 测试通过libpq实用大对象
14781502
*
1479-
* Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
1503+
* Portions Copyright (c) 1996-2020, PostgreSQL Global Development Group
14801504
* Portions Copyright (c) 1994, Regents of the University of California
14811505
*
14821506
*
14831507
* IDENTIFICATION
14841508
* src/test/examples/testlo.c
14851509
*
1486-
*-------------------------------------------------------------------------
1510+
*-----------------------------------------------------------------
14871511
*/
14881512
#include <stdio.h>
14891513
#include <stdlib.h>
@@ -1496,10 +1520,10 @@ ____________________________________________________________________________-->
14961520
#include "libpq-fe.h"
14971521
#include "libpq/libpq-fs.h"
14981522

1499-
#define BUFSIZE 1024
1523+
#define BUFSIZE 1024
15001524

15011525
/*
1502-
* importFile
1526+
* importFile -
15031527
* 把文件 "in_filename" 作为一个大对象 "lobjOid" 载入到数据库
15041528
*
15051529
*/
@@ -1613,6 +1637,7 @@ overwrite(PGconn *conn, Oid lobjId, int start, int len)
16131637
lo_close(conn, lobj_fd);
16141638
}
16151639

1640+
16161641
/*
16171642
* exportFile -
16181643
* 把大对象 "lobjOid" 导出成文件 "out_filename"

0 commit comments

Comments
 (0)