diff --git a/content/docs-lite/zh/docs/Developerguide/CopyManager.md b/content/docs-lite/zh/docs/Developerguide/CopyManager.md deleted file mode 100644 index 126da74229bdadd652042cd58588e86e21ced294..0000000000000000000000000000000000000000 --- a/content/docs-lite/zh/docs/Developerguide/CopyManager.md +++ /dev/null @@ -1,109 +0,0 @@ -# CopyManager - -CopyManager是openGauss JDBC驱动中提供的一个API接口类,用于批量向openGauss中导入数据。 - -## CopyManager的继承关系 - -CopyManager类位于org.postgresql.copy Package中,继承自java.lang.Object类,该类的声明如下: - -``` -public class CopyManager -extends Object -``` - -## 构造方法 - -public CopyManager\(BaseConnection connection\) - -throws SQLException - -## 常用方法 - -**表 1** CopyManager常用方法 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

返回值

-

方法

-

描述

-

throws

-

CopyIn

-

copyIn(String sql)

-

-

-

SQLException

-

long

-

copyIn(String sql, InputStream from)

-

使用COPY FROM STDIN从InputStream中快速向数据库中的表加载数据。

-

SQLException,IOException

-

long

-

copyIn(String sql, InputStream from, int bufferSize)

-

使用COPY FROM STDIN从InputStream中快速向数据库中的表加载数据。

-

SQLException,IOException

-

long

-

copyIn(String sql, Reader from)

-

使用COPY FROM STDIN从Reader中快速向数据库中的表加载数据。

-

SQLException,IOException

-

long

-

copyIn(String sql, Reader from, int bufferSize)

-

使用COPY FROM STDIN从Reader中快速向数据库中的表加载数据。

-

SQLException,IOException

-

CopyOut

-

copyOut(String sql)

-

-

-

SQLException

-

long

-

copyOut(String sql, OutputStream to)

-

将一个COPY TO STDOUT的结果集从数据库发送到OutputStream类中。

-

SQLException,IOException

-

long

-

copyOut(String sql, Writer to)

-

将一个COPY TO STDOUT的结果集从数据库发送到Writer类中。

-

SQLException,IOException

-
- diff --git "a/content/docs-lite/zh/docs/Developerguide/Database\345\222\214Schema\350\256\276\350\256\241.md" "b/content/docs-lite/zh/docs/Developerguide/Database\345\222\214Schema\350\256\276\350\256\241.md" deleted file mode 100644 index 0bfba80a0c94da32e2311e31fb2f4bd2adc70c6d..0000000000000000000000000000000000000000 --- "a/content/docs-lite/zh/docs/Developerguide/Database\345\222\214Schema\350\256\276\350\256\241.md" +++ /dev/null @@ -1,21 +0,0 @@ -# Database和Schema设计 - -openGauss中可以使用Database和Schema实现业务的隔离,区别在于Database的隔离更加彻底,各个Database之间共享资源极少,可实现连接隔离、权限隔离等,Database之间无法直接互访。Schema隔离的方式共用资源较多,可以通过grant与revoke语法便捷地控制不同用户对各Schema及其下属对象的权限。 - -- 从便捷性和资源共享效率上考虑,推荐使用Schema进行业务隔离。 -- 建议系统管理员创建Schema和Database,再赋予相关用户对应的权限。 - -## Database设计建议 - -- 【规则】在实际业务中,根据需要创建新的Database,不建议直接使用数据库实例默认的postgres数据库。 -- 【建议】一个数据库实例内,用户自定义的Database数量建议不超过3个。 -- 【建议】为了适应全球化的需求,使数据库编码能够存储与表示绝大多数的字符,建议创建Database的时候使用UTF-8编码。 -- 【关注】创建Database时,需要重点关注字符集编码\(ENCODING\)和兼容性\(DBCOMPATIBILITY\)两个配置项。openGauss支持A、B、C和PG四种兼容模式,分别表示兼容O语法、MY语法、TD语法和POSTGRES语法,不同兼容模式下的语法行为存在一定差异,默认为A兼容模式。 -- 【关注】Database的owner默认拥有该Database下所有对象的所有权限,包括删除权限。删除权限影响较大,请谨慎使用。 - -## Schema设计建议 - -- 【关注】如果该用户不具有sysadmin权限或者不是该Schema的owner,要访问Schema下的对象,需要同时给用户赋予Schema的usage权限和对象的相应权限。 -- 【关注】如果要在Schema下创建对象,需要授予操作用户该Schema的create权限。 -- 【关注】Schema的owner默认拥有该Schema下对象的所有权限,包括删除权限。删除权限影响较大,请谨慎使用。 - diff --git "a/content/docs-lite/zh/docs/Developerguide/JDBC\345\214\205-\351\251\261\345\212\250\347\261\273\345\222\214\347\216\257\345\242\203\347\261\273.md" "b/content/docs-lite/zh/docs/Developerguide/JDBC\345\214\205-\351\251\261\345\212\250\347\261\273\345\222\214\347\216\257\345\242\203\347\261\273.md" deleted file mode 100644 index 2899e22d0244ded5633241e86f0d32ef95b71cd2..0000000000000000000000000000000000000000 --- "a/content/docs-lite/zh/docs/Developerguide/JDBC\345\214\205-\351\251\261\345\212\250\347\261\273\345\222\214\347\216\257\345\242\203\347\261\273.md" +++ /dev/null @@ -1,70 +0,0 @@ -# JDBC包、驱动类和环境类 - -## JDBC包 - -openGauss提供两种JDBCjar包:postgresql.jar和openGauss-jdbc-x.x.x.jar,两种jar包功能一致,仅仅是为了解决和PostgreSQL之间的JDBC驱动包名冲突。 - -在Linux服务器端源代码目录下执行build.sh,获得驱动jar包postgresql.jar和opengauss-jdbc-x.x.x.jar,包位置在源代码内output目录下。也可以从官网发布包中获取,包名为openGauss-x.x.x-JDBC.tar.gz。 - -驱动包与PostgreSQL保持兼容,其中类名、类结构与PostgreSQL驱动完全一致,曾经运行于PostgreSQL的应用程序可以直接移植到当前系统使用。 - -## 驱动类 - ->![](public_sys-resources/icon-note.gif) **说明:** -> ->1. openGauss在JDBC的使用上与PG的使用方法保持兼容。在同一个JVM虚拟机里加载PostgreSQL和openGauss的JDBC同名驱动时,可能存在org.postgresql.Driver驱动类冲突问题。 ->2. 相比于PG驱动,openGauss JDBC驱动主要做了以下特性的增强: ->3. 支持SHA256加密方式登录。 ->4. 支持对接实现sf4j接口的第三方日志框架。 ->5. 支持容灾切换。 - -## 环境类 - -客户端需配置JDK1.8,配置方法如下: - -1. DOS窗口输入“java -version”,查看JDK版本,确认为JDK1.8版本。如果未安装JDK,请从官方网站下载安装包并安装。 -2. 根据如下步骤配置系统环境变量。 - 1. 右键单击“我的电脑“,选择“属性“。 - 2. 在“系统“页面左侧导航栏单击“高级系统设置“。 - 3. 在“系统属性“页面,“高级“页签上单击“环境变量“。 - 4. 在“环境变量“页面上,“系统变量“区域单击“新建“或“编辑“配置系统变量。变量说明请参见[表1](#zh-cn_topic_0283136979_zh-cn_topic_0237120378_zh-cn_topic_0213179123_table1625616152473)。 - - **表 1** 变量说明 - - - - - - - - - - - - - - - - - - - - -

变量名

-

操作

-

变量值

-

JAVA_HOME

-
  • 若存在,则单击“编辑”。
  • 若不存在,则单击“新建”。
-

JAVA的安装目录。

-

例如:C:\Program Files\Java\jdk1.8.0_131

-

Path

-

编辑

-
  • 若配置了JAVA_HOME,则在变量值的最前面加上: %JAVA_HOME%\bin;
  • 若未配置JAVA_HOME,则在变量值的最前面加上 JAVA安装的全路径:

    C:\Program Files\Java\jdk1.8.0_131\bin;

    -
-

CLASSPATH

-

新建

-

.;%JAVA_HOME%\lib;%JAVA_HOME%\lib\tools.jar;

-
- - - diff --git "a/content/docs-lite/zh/docs/Developerguide/JDBC\345\270\270\347\224\250\345\217\202\346\225\260\345\217\202\350\200\203.md" "b/content/docs-lite/zh/docs/Developerguide/JDBC\345\270\270\347\224\250\345\217\202\346\225\260\345\217\202\350\200\203.md" deleted file mode 100644 index f2eb3c903b15307afec61ddc9b1d5795556c681b..0000000000000000000000000000000000000000 --- "a/content/docs-lite/zh/docs/Developerguide/JDBC\345\270\270\347\224\250\345\217\202\346\225\260\345\217\202\350\200\203.md" +++ /dev/null @@ -1,109 +0,0 @@ -# JDBC常用参数参考 - -## targetServerType - -**原理:**值为master时会依次尝试连接串中配置的ip,直到能够连接到集群中的主机, - -值为slave时会依次尝试连接串中配置的ip,直到能够连接到集群中的备机(查询语句为:select local\_role, db\_state from pg\_stat\_get\_stream\_replications\(\);)。 - -**建议:**有写操作的业务建议配置master,以保证主备切换后能正常连接主机,但是要注意在主备倒换过程中备机没有完全升主的时候无法正常建连,导致业务语句无法正常执行。 - -## hostRecheckSeconds - -**原理:**JDBC内部存储的dn列表保持可信的时间,未超过此时间时会从中直接读取存储的主机地址,当超过此时间时或者在可信时间内连接主机失败时会通过更新dn列表中该节点状态,之后连接其他的ip。 - -**建议:**默认值10s,建议根据业务进行调整,配合参数targetServerType使用。 - -## allowReadOnly - -**原理:**是否可以通过setReadOnly来修改事务访问模式,如果为true则可以修改,如果为false则无法通过此接口来修改,修改语句为SET SESSION CHARACTERISTICS AS TRANSACTION + READ ONLY / READ WEITE。 - -**建议:**保持默认值为true。 - -## fetchsize - -**原理:**fetchsize在设置为n后,数据库服务器端在执行查询后,调用者在执行resultset.next\(\)的时候,JDBC会先与服务器端进行通信,取n条数据到jdbc的客户端中,然后返回第一条给调用者,当调用者取到第n+1条数据的时候,会再次到数据库服务端去拿数据。 - -**作用:**避免了数据库一下把所有结果全部传输到客户端来,将客户端的内存资源撑爆掉。 - -**建议:**建议根据自身的业务查询数据数量和客户端机器内存情况来配置此参数,设置fetchsize时要关闭自动提交\(autocommit=false\),否则会导致fetchsize无法生效。 - -## defaultRowFetchSize - -**作用:**fetchsize默认值为0,defaultRowFetchSize会修改fetchsize的默认值。 - -## batchMode - -**作用:**用于确定是否使用batch模式连接。默认值为on,开启后可以提升批量更新的性能,同时批量更新的返回值会发生改变,例如,批量插入三条数据,在开启时返回值为\[3,0,0\],在关闭后返回值为\[1,1,1\]。 - -**建议:**如果本身业务框架\(例如hibernate\)在批量更新时会检测返回值,可以通过调整此参数来解决。 - -## loginTimeout - -**作用:**控制与数据库建联时间,其中时间包括connectiontimeout和sockettimeout,超过阈值则退出。计算方式为:loginTimeout=connectiontimeout\*节点数量+连接认证时间+初始化语句执行时间。 - -**建议:**配置后会每次建连都会开启一个异步线程,在连接数较多的情况可能会导致客户端压力增大,如果业务确认需要此设置此参数,需要注意在集中式下建议调整为3\*connectTimeout防止在网络异常情况且第三个IP为主的情况下,无法连接。 - ->![](public_sys-resources/icon-notice.gif) **须知:** -> ->此参数设置后对于多ip而言,时间是尝试连接ip的时间,可能会出现因为设置的值较小导致后面的ip无法连接的问题,例如设置了三个ip,如果logintimeout为5s,但前两个ip建连总共用了5s,第三个ip会无法进行连接,在集中式环境下,此最后一个ip恰好为主机,可能会导致自动寻主失败。 - -## cancelSignalTimeout - -**作用:**发送取消消息本身可能会阻塞,此属性控制用于取消命令的“connect超时”和“socket超时”。超时时间单位为秒。主要为了防止连接超时取消时本身执行超时检测。 - -**建议:**默认值为10秒,建议根据业务进行调整。 - -## connectTimeout - -**作用:**控制建立连接时套接字超时阈值(此时是jdbc通过socket连接到数据的时间,并不是返回connection对象的时间),超过阈值查找下一个IP。 - -**建议:**该参数决定了每个节点TCP连接建立的最大超时时间,如果某节点网络故障,与该节点建立连接时会等待connectTimeout超时,然后尝试连接下一个节点。考虑到网络抖动,时延等情况,默认建议设置为3s。 - -## socketTimeout - -**作用:**控制套接字操作超时值,如果业务语句执行或者从网络读取数据流超过此阈值,连接中断(即语句超过规定时间执行,没有数据返回的时候)。 - -**建议:**该参数限制单SQL最长的执行时间,单语句执行超过该值则会超时报错退出,建议根据业务特征进行配置。 - -## socketTimeoutInConnecting ## -**作用:** 控制建连阶段套接字操作超时值,在建连阶段,如果从网络中读取数据流超过此阈值,则尝试查找下一个节点建连。 - -**建议:** 该参数仅影响建连阶段的socket超时时间,如果未配置,默认为5s。 - -## autosave - -**作用:**值为always时可以在事务中每个语句前面设置一个savepoint点,在事务中语句执行报错时会返回到最近的上一个savepoint点,可以让事务中后续语句可以正常执行,最终可以正常提交。 - -**建议:**不建议设置此参数,性能劣化严重。 - -## currentSchema - -**作用:**设置当前连接的schema,如果未设置,则默认schema为连接使用的用户名。 - -**建议:**建议配置此参数,业务数据所在的schema。 - -## prepareThreshold - -**作用:**默认值为5,如果一个会话连续多次执行同一个SQL,在达到prepareThreshold次数以上时,JDBC将不再对这个SQL发送parse命令,会将其缓存起来,提升执行速度。 - -**建议:**默认值为5,根据业务需要进行调整。 - -## preparedStatementCacheQueries - -**作用:**确定每个连接中缓存的查询数,默认情况下是256。若在prepareStatement\(\)调用中使用超过256个不同的查询,则最近最少使用的查询缓存将被丢弃。 - -**建议:**默认值为256,根据业务需要进行调整。配合prepareThreshold使用。 - -## blobMode - -**作用:**setBinaryStream方法为不同类型的数据赋值,设置为on时表示为blob类型数据赋值,设置为off时表示为bytea类型数据赋值,默认为on。例如在preparestatement和callablestatement对象中对参数进行赋值操作。 - -**建议:**默认值为true。 - -## setAutocommit方法 - -**作用:**值为true时,执行每个语句都会自动开启事务,在执行结束后自动提交事务,即每个语句都是一个事务。值为false时,会自动开启一个事务,事务需要通过执行SQL手动提交。 - -**建议:**根据业务特征进行调整,如果基于性能或者其它方面考虑,需要关闭autocommit时,需要应用程序自己来保证事务的提交。例如,在指定的业务SQL执行完之后做显式提交,特别是客户端退出之前务必保证所有的事务已经提交。 - diff --git "a/content/docs-lite/zh/docs/Developerguide/JDBC\346\216\245\345\217\243\345\217\202\350\200\203.md" "b/content/docs-lite/zh/docs/Developerguide/JDBC\346\216\245\345\217\243\345\217\202\350\200\203.md" deleted file mode 100644 index 51bdafc5ec07c4e9b157170c6a8c7176d2822f3e..0000000000000000000000000000000000000000 --- "a/content/docs-lite/zh/docs/Developerguide/JDBC\346\216\245\345\217\243\345\217\202\350\200\203.md" +++ /dev/null @@ -1,31 +0,0 @@ -# JDBC接口参考 - -JDBC接口是一套提供给用户的API方法,本节将对部分常用接口做具体描述,若涉及其他接口可参考JDK1.8(软件包)/JDBC4.0中相关内容。 - -- **[java.sql.Connection](java-sql-Connection.md)** - -- **[java.sql.CallableStatement](java-sql-CallableStatement.md)** - -- **[java.sql.DatabaseMetaData](java-sql-DatabaseMetaData.md)** - -- **[java.sql.Driver](java-sql-Driver.md)** - -- **[java.sql.PreparedStatement](java-sql-PreparedStatement.md)** - -- **[java.sql.ResultSet](java-sql-ResultSet.md)** - -- **[java.sql.ResultSetMetaData](java-sql-ResultSetMetaData.md)** - -- **[java.sql.Statement](java-sql-Statement.md)** - -- **[javax.sql.ConnectionPoolDataSource](javax-sql-ConnectionPoolDataSource.md)** - -- **[javax.sql.DataSource](javax-sql-DataSource.md)** - -- **[javax.sql.PooledConnection](javax-sql-PooledConnection.md)** - -- **[javax.naming.Context](javax-naming-Context.md)** - -- **[javax.naming.spi.InitialContextFactory](javax-naming-spi-InitialContextFactory.md)** - -- **[CopyManager](CopyManager.md)** \ No newline at end of file diff --git "a/content/docs-lite/zh/docs/Developerguide/JDBC\351\205\215\347\275\256.md" "b/content/docs-lite/zh/docs/Developerguide/JDBC\351\205\215\347\275\256.md" deleted file mode 100644 index 7a6305b00fc306a3c0b6b403dd2a0765c4eab930..0000000000000000000000000000000000000000 --- "a/content/docs-lite/zh/docs/Developerguide/JDBC\351\205\215\347\275\256.md" +++ /dev/null @@ -1,61 +0,0 @@ -# JDBC配置 - -目前,openGauss相关的第三方工具都是通过JDBC进行连接的,此部分将介绍工具配置时的注意事项。 - -## 连接参数 - -- 【关注】第三方工具通过JDBC连接openGauss时,JDBC向openGauss发起连接请求,会默认添加以下配置参数,详见JDBC代码ConnectionFactoryImpl类的实现。 - - ``` - params = { - { "user", user }, - { "database", database }, - { "client_encoding", "UTF8" }, - { "DateStyle", "ISO" }, - { "extra_float_digits", "3" }, - { "TimeZone", createPostgresTimeZone() }, - }; - ``` - - 这些参数可能会导致JDBC客户端的行为与gsql客户端的行为不一致,例如,Date数据显示方式、浮点数精度表示、timezone显示。 - - 如果实际期望和这些配置不符,建议在java连接设置代码中显式设定这些参数。 - -- 【建议】通过JDBC连接数据库时,会设置extra_float_digits=3,gsql中设置为extra_float_digits=0,可能会使同一条数据在JDBC显示和gsql显示的精度不同。 - -- 【建议】对于精度敏感的场景,建议使用numeric类型。 - -- 【建议】通过JDBC连接数据库时,应该保证下面三个时区设置一致: - - JDBC客户端所在主机的时区。 - - openGauss数据库实例所在主机的时区。 - - openGauss数据库实例配置过程中时区。 - - >![](public_sys-resources/icon-note.gif) **说明:** - > - >时区设置相关的操作,请参考《安装指南》中“初始配置 \> 同步系统时间”章节内容。 - - - -## fetchsize - -【关注】在应用程序中,如果需要使用fetchsize,必须关闭autocommit。开启autocommit,会令fetchsize配置失效。 - -## autocommit - -【建议】在JDBC向openGauss申请连接的代码中,建议显式打开autocommit开关。如果基于性能或者其它方面考虑,需要关闭autocommit时,需要应用程序自己来保证事务的提交。例如,在指定的业务SQL执行完之后做显式提交,特别是客户端退出之前务必保证所有的事务已经提交。 - -## 释放连接 - -【建议】推荐使用连接池限制应用程序的连接数。每执行一条SQL就连接一次数据库,是一种不好SQL的编写习惯。 - -【建议】在应用程序完成作业任务之后,应当及时断开和openGauss的连接,释放资源。建议在任务中设置session超时时间参数。 - -【建议】使用JDBC连接池,在将连接释放给连接池前,需要执行以下操作,重置会话环境。否则,可能会因为历史会话信息导致的对象冲突。 - -- 如果在连接中设置了GUC参数,那么在将连接归还连接池之前,必须使用“SET SESSION AUTHORIZATION DEFAULT;RESET ALL;”将连接的状态清空。 -- 如果使用了临时表,那么在将连接归还连接池之前,必须将临时表删除。 - -## CopyManager - -【建议】在不使用ETL工具,数据入库实时性要求又比较高的情况下,建议在开发应用程序时,使用openGauss JDBC驱动的copyManger接口进行微批导入。 - diff --git a/content/docs-lite/zh/docs/Developerguide/PQcancel.md b/content/docs-lite/zh/docs/Developerguide/PQcancel.md deleted file mode 100644 index 1f326762799ec5e77ae0173208678ed6377c94fb..0000000000000000000000000000000000000000 --- a/content/docs-lite/zh/docs/Developerguide/PQcancel.md +++ /dev/null @@ -1,54 +0,0 @@ -# PQcancel - -## 功能描述 - -要求服务器放弃处理当前命令。 - -## 原型 - -``` -int PQcancel(PGcancel *cancel, char *errbuf, int errbufsize); -``` - -## 参数 - -**表 1** PQcancel参数 - - - - - - - - - - - - - - - - -

关键字

-

参数说明

-

cancel

-

指向包含cancel信息的对象指针。

-

errbuf

-

出错保存错误信息的buffer。

-

errbufsize

-

保存错误信息的buffer大小。

-
- -## 返回值 - -int:执行结果为1表示成功,0表示失败,失败原因存到errbuf中。 - -## 注意事项 - -- 成功发送并不保证请求将产生任何效果。如果取消有效,当前命令将提前终止并返回错误结果。如果取消失败(例如,因为服务器已经处理完命令),无返回结果。 -- 如果errbuf是信号处理程序中的局部变量,则可以安全地从信号处理程序中调用PQcancel。就PQcancel而言,PGcancel对象是只读的,因此它也可以从一个线程中调用,这个线程与操作PGconn对象线程是分离的。 - -## 示例 - -请参见[示例](示例-libpq.md)章节。 - diff --git a/content/docs-lite/zh/docs/Developerguide/PQclear.md b/content/docs-lite/zh/docs/Developerguide/PQclear.md deleted file mode 100644 index 807ffdaa2399f3e44020950764d403f8972afdfd..0000000000000000000000000000000000000000 --- a/content/docs-lite/zh/docs/Developerguide/PQclear.md +++ /dev/null @@ -1,39 +0,0 @@ -# PQclear - -## 功能描述 - -释放与PGresult相关联的存储空间,任何不再需要的查询结果都应该用PQclear释放掉。 - -## 原型 - -``` -void PQclear(PGresult *res); -``` - -## 参数 - -**表 1** PQclear参数 - - - - - - - - - - -

关键字

-

参数说明

-

res

-

包含查询结果的对象指针。

-
- -## 注意事项 - -PGresult不会自动释放,当提交新的查询时它并不消失,甚至断开连接后也不会。要删除它,必须调用PQclear,否则则会有内存泄漏。 - -## 示例 - -请参见[示例](示例-libpq.md)章节。 - diff --git a/content/docs-lite/zh/docs/Developerguide/PQconnectStart.md b/content/docs-lite/zh/docs/Developerguide/PQconnectStart.md deleted file mode 100644 index 0987b9de2d9fc608b0ad76d21b85f90327db4366..0000000000000000000000000000000000000000 --- a/content/docs-lite/zh/docs/Developerguide/PQconnectStart.md +++ /dev/null @@ -1,35 +0,0 @@ -# PQconnectStart - -## 功能描述 - -与数据库服务器建立一次非阻塞的连接。 - -## 原型 - -``` -PGconn* PQconnectStart(const char* conninfo); -``` - -## 参数 - -**表 1** - - - - - - - - - - -

关键字

-

参数说明

-

conninfo

-

连接信息字符串。可以为空,这样将会使用默认参数。也可以包含由空格分隔的一个或多个参数设置,还可以包含一个URI。

-
- -## 返回值 - -PGconn类型指针。 - diff --git a/content/docs-lite/zh/docs/Developerguide/PQconnectdb.md b/content/docs-lite/zh/docs/Developerguide/PQconnectdb.md deleted file mode 100644 index 784b28b9754a336aca3b34fa95e0b74bab24d153..0000000000000000000000000000000000000000 --- a/content/docs-lite/zh/docs/Developerguide/PQconnectdb.md +++ /dev/null @@ -1,44 +0,0 @@ -# PQconnectdb - -## 功能描述 - -与数据库服务器建立一个新的连接。 - -## 原型 - -``` -PGconn *PQconnectdb(const char *conninfo); -``` - -## 参数 - -**表 1** PQconnectdb参数 - - - - - - - - - - -

关键字

-

参数说明

-

conninfo

-

链接字符串,字符串中的字段见链接字符章节。

-
- -## 返回值 - -PGconn \*:指向包含链接的对象指针,内存在函数内部申请。 - -## 注意事项 - -- 这个函数用从一个字符串conninfo来的参数与数据库打开一个新的链接。 -- 传入的参数可以为空,表明使用所有缺省的参数,或者可以包含一个或更多个用空白间隔的参数设置,或者它可以包含一个URL。 - -## 示例 - -请参见[示例](示例-libpq.md)章节。 - diff --git a/content/docs-lite/zh/docs/Developerguide/PQconnectdbParams.md b/content/docs-lite/zh/docs/Developerguide/PQconnectdbParams.md deleted file mode 100644 index e35fce952d3fb88f152422aac7900eacd1f2e0b5..0000000000000000000000000000000000000000 --- a/content/docs-lite/zh/docs/Developerguide/PQconnectdbParams.md +++ /dev/null @@ -1,55 +0,0 @@ -# PQconnectdbParams - -## 功能描述 - -与数据库服务器建立一个新的连接。 - -## 原型 - -``` -PGconn *PQconnectdbParams(const char * const *keywords, - const char * const *values, - int expand_dbname); -``` - -## 参数 - -**表 1** PQconnectdbParams参数 - - - - - - - - - - - - - - - - -

关键字

-

参数说明

-

keywords

-

定义为一个字符串的数组,每个都成为一个关键字。

-

values

-

给每个关键字一个值。

-

expand_dbname

-

当expand_dbname是非零的时,允许将dbname的关键字值看做一个连接字符串。只有第一个出现的dbname是这样展开的,任何随后的dbname值作为纯数据库名处理。

-
- -## 返回值 - -PGconn \*:指向包含链接的对象指针,内存在函数内部申请。 - -## 注意事项 - -这个函数用从两个NULL结束的数组中来的参数打开一个新的数据库连接。与PQsetdbLogin不同的是,可以不必更换函数签名(名字)就可以扩展参数集,所以建议应用程序中使用这个函数(或者它的类似的非阻塞变种PQconnectStartParams和PQconnectPoll)。 - -## 示例 - -请参见[示例](示例-libpq.md)章节。 - diff --git a/content/docs-lite/zh/docs/Developerguide/PQconninfoParse.md b/content/docs-lite/zh/docs/Developerguide/PQconninfoParse.md deleted file mode 100644 index 5938033a1b77544730477173936288a111aed68f..0000000000000000000000000000000000000000 --- a/content/docs-lite/zh/docs/Developerguide/PQconninfoParse.md +++ /dev/null @@ -1,40 +0,0 @@ -# PQconninfoParse - -## 功能描述 - -根据连接,返回已解析的连接选项。 - -## 原型 - -``` -PQconninfoOption* PQconninfoParse(const char* conninfo, char** errmsg); -``` - -## 参数 - -**表 1** - - - - - - - - - - - - - -

关键字

-

参数说明

-

conninfo

-

被传递的字符串。可以为空,这样将会使用默认参数。也可以包含由空格分隔的一个或多个参数设置,还可以包含一个URI。

-

errmsg

-

错误信息。

-
- -## 返回值 - -PQconninfoOption类型指针。 - diff --git a/content/docs-lite/zh/docs/Developerguide/PQerrorMessage.md b/content/docs-lite/zh/docs/Developerguide/PQerrorMessage.md deleted file mode 100644 index fd6cdb2510ba7a3d307a2b3f407ba1fa8e4b3af5..0000000000000000000000000000000000000000 --- a/content/docs-lite/zh/docs/Developerguide/PQerrorMessage.md +++ /dev/null @@ -1,39 +0,0 @@ -# PQerrorMessage - -## 功能描述 - -返回连接上的错误信息。 - -## 原型 - -``` -char* PQerrorMessage(const PGconn* conn); -``` - -## 参数 - -**表 1** - - - - - - - - - - -

关键字

-

参数说明

-

conn

-

连接句柄。

-
- -## 返回值 - -char类型指针。 - -## 示例 - -参见:[示例](示例-libpq.md) - diff --git a/content/docs-lite/zh/docs/Developerguide/PQexec.md b/content/docs-lite/zh/docs/Developerguide/PQexec.md deleted file mode 100644 index c05cdd6ab5c19ae85fa249d007fbff7411566692..0000000000000000000000000000000000000000 --- a/content/docs-lite/zh/docs/Developerguide/PQexec.md +++ /dev/null @@ -1,51 +0,0 @@ -# PQexec - -## 功能描述 - -向服务器提交一条命令并等待结果。 - -## 原型 - -``` -PGresult *PQexec(PGconn *conn, const char *command); -``` - -## 参数 - -**表 1** PQexec参数 - - - - - - - - - - - - - -

关键字

-

参数说明

-

conn

-

指向包含链接的对象指针。

-

command

-

需要执行的查询字符串。

-
- -## 返回值 - -PGresult:包含查询结果的对象指针。 - -## 注意事项 - -应该调用PQresultStatus函数来检查任何错误的返回值(包括空指针的值,在这种情况下它将返回PGRES\_FATAL\_ERROR)。使用PQerrorMessage获取有关错误的更多信息。 - ->![](public_sys-resources/icon-notice.gif) **须知:** ->命令字符串可以包括多个SQL命令(用分号分隔)。在一个PQexec调用中发送的多个查询是在一个事务里处理的,除非在查询字符串里有明确的BEGIN/COMMIT命令把整个字符串分隔成多个事务。请注意,返回的PGresult结构只描述字符串里执行的最后一条命令的结果,如果有一个命令失败,那么字符串处理的过程就会停止,并且返回的PGresult会描述错误条件。 - -## 示例 - -请参见[示例](示例-libpq.md)章节。 - diff --git a/content/docs-lite/zh/docs/Developerguide/PQexecParams.md b/content/docs-lite/zh/docs/Developerguide/PQexecParams.md deleted file mode 100644 index 6db42bee0836d344f1e1889eea97b1fcf146f493..0000000000000000000000000000000000000000 --- a/content/docs-lite/zh/docs/Developerguide/PQexecParams.md +++ /dev/null @@ -1,77 +0,0 @@ -# PQexecParams - -## 功能描述 - -执行一个绑定参数的命令。 - -## 原型 - -``` -PGresult* PQexecParams(PGconn* conn, - const char* command, - int nParams, - const Oid* paramTypes, - const char* const* paramValues, - const int* paramLengths, - const int* paramFormats, - int resultFormat); -``` - -## 参数 - -**表 1** PQexecParams参数 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

关键字

-

参数说明

-

conn

-

连接句柄。

-

command

-

SQL文本串。

-

nParams

-

绑定参数的个数。

-

paramTypes

-

绑定参数类型。

-

paramValues

-

绑定参数的值。

-

paramLengths

-

参数长度。

-

paramFormats

-

参数格式(文本或二进制)。

-

resultFormat

-

返回结果格式(文本或二进制)。

-
- -## 返回值 - -PGresult类型指针。 - diff --git a/content/docs-lite/zh/docs/Developerguide/PQexecParamsBatch.md b/content/docs-lite/zh/docs/Developerguide/PQexecParamsBatch.md deleted file mode 100644 index 33fd5fc8156b804603fce02ae9a511f440dced27..0000000000000000000000000000000000000000 --- a/content/docs-lite/zh/docs/Developerguide/PQexecParamsBatch.md +++ /dev/null @@ -1,83 +0,0 @@ -# PQexecParamsBatch - -## 功能描述 - -执行一个批量绑定参数的命令。 - -## 原型 - -``` -PGresult* PQexecParamsBatch(PGconn* conn, - const char* command, - int nParams, - int nBatch, - const Oid* paramTypes, - const char* const* paramValues, - const int* paramLengths, - const int* paramFormats, - int resultFormat); -``` - -## 参数 - -**表 1** PQexecParamsBatch参数 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

关键字

-

参数说明

-

conn

-

连接句柄。

-

command

-

SQL文本串。

-

nParams

-

绑定参数的个数。

-

nBatch

-

批量操作数。

-

paramTypes

-

绑定参数类型。

-

paramValues

-

绑定参数的值。

-

paramLengths

-

参数长度。

-

paramFormats

-

参数格式(文本或二进制)。

-

resultFormat

-

返回结果格式(文本或二进制)。

-
- -## 返回值 - -PGresult类型指针。 - diff --git a/content/docs-lite/zh/docs/Developerguide/PQexecPrepared.md b/content/docs-lite/zh/docs/Developerguide/PQexecPrepared.md deleted file mode 100644 index 92bf6f8c7a85737380a604d5e1ed104500b2190c..0000000000000000000000000000000000000000 --- a/content/docs-lite/zh/docs/Developerguide/PQexecPrepared.md +++ /dev/null @@ -1,71 +0,0 @@ -# PQexecPrepared - -## 功能描述 - -发送一个请求来用给定参数执行一个预备语句,并且等待结果。 - -## 原型 - -``` -PGresult* PQexecPrepared(PGconn* conn, - const char* stmtName, - int nParams, - const char* const* paramValues, - const int* paramLengths, - const int* paramFormats, - int resultFormat); -``` - -## 参数 - -**表 1** PQexecPrepared参数 - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

关键字

-

参数说明

-

conn

-

连接句柄。

-

stmtName

-

stmt名称,可以用""或者NULL来引用未命名语句,否则它必须是一个现有预备语句的名字。

-

nParams

-

参数个数。

-

paramValues

-

参数的实际值。

-

paramLengths

-

参数的实际数据长度。

-

paramFormats

-

参数的格式(文本或二进制)。

-

resultFormat

-

结果的格式(文本或二进制)。

-
- -## 返回值 - -PGresult类型指针。 - diff --git a/content/docs-lite/zh/docs/Developerguide/PQexecPreparedBatch.md b/content/docs-lite/zh/docs/Developerguide/PQexecPreparedBatch.md deleted file mode 100644 index 076837d8b14c2bf73cbd7dbb680626164ccfa59d..0000000000000000000000000000000000000000 --- a/content/docs-lite/zh/docs/Developerguide/PQexecPreparedBatch.md +++ /dev/null @@ -1,77 +0,0 @@ -# PQexecPreparedBatch - -## 功能描述 - -发送一个请求来用给定的批量参数执行一个预备语句,并且等待结果。 - -## 原型 - -``` -PGresult* PQexecPreparedBatch(PGconn* conn, - const char* stmtName, - int nParams, - int nBatchCount, - const char* const* paramValues, - const int* paramLengths, - const int* paramFormats, - int resultFormat); -``` - -## 参数 - -**表 1** PQexecPreparedBatch参数 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

关键字

-

参数说明

-

conn

-

连接句柄。

-

stmtName

-

stmt名称,可以用""或者NULL来引用未命名语句,否则它必须是一个现有预备语句的名字。

-

nParams

-

参数个数。

-

nBatchCount

-

批量数。

-

paramValues

-

参数的实际值。

-

paramLengths

-

参数的实际数据长度。

-

paramFormats

-

参数的格式(文本或二进制)。

-

resultFormat

-

结果的格式(文本或二进制)。

-
- -## 返回值 - -PGresult类型指针。 - diff --git a/content/docs-lite/zh/docs/Developerguide/PQfinish.md b/content/docs-lite/zh/docs/Developerguide/PQfinish.md deleted file mode 100644 index 26a48ad681031ce28d2299937dced4e56d5c1007..0000000000000000000000000000000000000000 --- a/content/docs-lite/zh/docs/Developerguide/PQfinish.md +++ /dev/null @@ -1,39 +0,0 @@ -# PQfinish - -## 功能描述 - -关闭与服务器的连接,同时释放被PGconn对象使用的存储器。 - -## 原型 - -``` -void PQfinish(PGconn *conn); -``` - -## 参数 - -**表 1** PQfinish参数 - - - - - - - - - - -

关键字

-

参数说明

-

conn

-

指向包含链接的对象指针。

-
- -## 注意事项 - -若PQstatus判断服务器链接尝试失败,应用程序调用PQfinish释放被PGconn对象使用的存储器,PQfinish调用后PGconn指针不可再次使用。 - -## 示例 - -请参见[示例](示例-libpq.md)章节。 - diff --git a/content/docs-lite/zh/docs/Developerguide/PQflush.md b/content/docs-lite/zh/docs/Developerguide/PQflush.md deleted file mode 100644 index 48e43a65d269f5badca39aeafdf4daccba56ae43..0000000000000000000000000000000000000000 --- a/content/docs-lite/zh/docs/Developerguide/PQflush.md +++ /dev/null @@ -1,43 +0,0 @@ -# PQflush - -## 功能描述 - -尝试将任何排队的输出数据刷新到服务器。 - -## 原型 - -``` -int PQflush(PGconn *conn); -``` - -## 参数 - -**表 1** PQflush参数 - - - - - - - - - - -

关键字

-

参数说明

-

conn

-

指向包含链接信息的对象指针

-
- -## 返回值 - -int:如果成功(或者如果发送队列为空),则返回0;如果由于某种原因失败,则返回-1;如果发送队列中的所有数据都发送失败,则返回1。(此情况只有在连接为非阻塞时才能发生),失败原因存到conn-\>error\_message中。 - -## 注意事项 - -在非阻塞连接上发送任何命令或数据之后,调用PQflush。如果返回1,则等待套接字变为读或写就绪。如果为写就绪状态,则再次调用PQflush。如果已经读到,调用PQconsumeInput,然后再次调用PQflush。重复,直到PQflush返回0。(必须检查读就绪,并用PQconsumeInput排出输入,因为服务器可以阻止试图向我们发送数据,例如,通知信息,直到我们读完它才会读我们的数据。)一旦PQflush返回0,就等待套接字准备好,然后按照上面描述读取响应。 - -## 示例 - -请参见[示例](示例-libpq.md)章节。 - diff --git a/content/docs-lite/zh/docs/Developerguide/PQfname.md b/content/docs-lite/zh/docs/Developerguide/PQfname.md deleted file mode 100644 index 3ab6daed0eddf58b466946141e424d5706675db9..0000000000000000000000000000000000000000 --- a/content/docs-lite/zh/docs/Developerguide/PQfname.md +++ /dev/null @@ -1,45 +0,0 @@ -# PQfname - -## 功能描述 - -返回与给定列号相关联的列名。列号从0开始。调用者不应该直接释放该结果。它将在相关的PGresult句柄被传递给PQclear之后被释放。 - -## 原型 - -``` -char *PQfname(const PGresult *res, - int column_number); -``` - -## 参数 - -**表 1** PQfname参数 - - - - - - - - - - - - - -

关键字

-

参数说明

-

res

-

操作结果句柄。

-

column_number

-

列数。

-
- -## 返回值 - -char类型指针。 - -## 示例 - -参见:[示例](示例-libpq.md) - diff --git a/content/docs-lite/zh/docs/Developerguide/PQfreeCancel.md b/content/docs-lite/zh/docs/Developerguide/PQfreeCancel.md deleted file mode 100644 index 781c325b3e1dbe407c86f6878d7afc07aa37730a..0000000000000000000000000000000000000000 --- a/content/docs-lite/zh/docs/Developerguide/PQfreeCancel.md +++ /dev/null @@ -1,39 +0,0 @@ -# PQfreeCancel - -## 功能描述 - -释放PQgetCancel创建的数据结构。 - -## 原型 - -``` -void PQfreeCancel(PGcancel *cancel); -``` - -## 参数 - -**表 1** PQfreeCancel参数 - - - - - - - - - - -

关键字

-

参数说明

-

cancel

-

指向包含cancel信息的对象指针。

-
- -## 注意事项 - -PQfreeCancel释放一个由前面的PQgetCancel创建的数据对象。 - -## 示例 - -请参见[示例](示例-libpq.md)章节。 - diff --git a/content/docs-lite/zh/docs/Developerguide/PQgetCancel.md b/content/docs-lite/zh/docs/Developerguide/PQgetCancel.md deleted file mode 100644 index a3a9e0658db04c7cb86200a4be73371e992dbbbf..0000000000000000000000000000000000000000 --- a/content/docs-lite/zh/docs/Developerguide/PQgetCancel.md +++ /dev/null @@ -1,43 +0,0 @@ -# PQgetCancel - -## 功能描述 - -创建一个数据结构,其中包含取消通过特定数据库连接发出的命令所需的信息。 - -## 原型 - -``` -PGcancel *PQgetCancel(PGconn *conn); -``` - -## 参数 - -**表 1** PQgetCancel参数 - - - - - - - - - - -

关键字

-

参数说明

-

conn

-

指向包含链接信息的对象指针。

-
- -## 返回值 - -PGcancel:指向包含cancel信息对象的指针。 - -## 注意事项 - -PQgetCancel创建一个给定PGconn连接对象的PGcancel对象。如果给定的conn是NULL或无效连接,它将返回NULL。PGcancel对象是一个不透明的结构,应用程序不能直接访问它;它只能传递给PQcancel或PQfreeCancel。 - -## 示例 - -请参见[示例](示例-libpq.md)章节。 - diff --git a/content/docs-lite/zh/docs/Developerguide/PQgetvalue.md b/content/docs-lite/zh/docs/Developerguide/PQgetvalue.md deleted file mode 100644 index 5bb259b1068dafa66505293ec2aae1eedb5c2340..0000000000000000000000000000000000000000 --- a/content/docs-lite/zh/docs/Developerguide/PQgetvalue.md +++ /dev/null @@ -1,55 +0,0 @@ -# PQgetvalue - -## 功能描述 - -返回一个PGresult的一行的单一域值。行和列号从 0 开始。调用者不应该直接释放该结果。它将在相关的PGresult句柄被传递给PQclear之后被释放。 - -## 原型 - -``` -char *PQgetvalue(const PGresult *res, - int row_number, - int column_number); -``` - -## 参数 - -**表 1** PQgetvalue参数 - - - - - - - - - - - - - - - - -

关键字

-

参数说明

-

res

-

操作结果句柄。

-

row_number

-

行数。

-

column_number

-

列数。

-
- -## 返回值 - -对于文本格式的数据,PQgetvalue返回的值是该域值的一种空值结束的字符串表示。 - -对于二进制格式的数据,该值是由该数据类型的typsend和typreceive函数决定的二进制表示。 - -如果该域值为空,则返回一个空串。 - -## 示例 - -参见:[示例](示例-libpq.md) - diff --git a/content/docs-lite/zh/docs/Developerguide/PQnfields.md b/content/docs-lite/zh/docs/Developerguide/PQnfields.md deleted file mode 100644 index 6765400a64886fc1edc15cf4fc627ad02df9be04..0000000000000000000000000000000000000000 --- a/content/docs-lite/zh/docs/Developerguide/PQnfields.md +++ /dev/null @@ -1,39 +0,0 @@ -# PQnfields - -## 功能描述 - -返回查询结果中每一行的列(域)数。 - -## 原型 - -``` -int PQnfields(const PGresult *res); -``` - -## 参数 - -**表 1** PQnfields参数 - - - - - - - - - - -

关键字

-

参数说明

-

res

-

操作结果句柄。

-
- -## 返回值 - -int类型数字。 - -## 示例 - -参见:[示例](示例-libpq.md) - diff --git a/content/docs-lite/zh/docs/Developerguide/PQntuples.md b/content/docs-lite/zh/docs/Developerguide/PQntuples.md deleted file mode 100644 index 16050c3127444562e68c985165c9fe667742d72d..0000000000000000000000000000000000000000 --- a/content/docs-lite/zh/docs/Developerguide/PQntuples.md +++ /dev/null @@ -1,39 +0,0 @@ -# PQntuples - -## 功能描述 - -返回查询结果中的行(元组)数。因为它返回一个整数结果,在 32 位操作系统上大型的结果集可能使返回值溢出。 - -## 原型 - -``` -int PQntuples(const PGresult *res); -``` - -## 参数 - -**表 1** PQntuples参数 - - - - - - - - - - -

关键字

-

参数说明

-

res

-

操作结果句柄。

-
- -## 返回值 - -int类型数字。 - -## 示例 - -参见:[示例](示例-libpq.md) - diff --git a/content/docs-lite/zh/docs/Developerguide/PQprepare.md b/content/docs-lite/zh/docs/Developerguide/PQprepare.md deleted file mode 100644 index fdc8d56f95883ec5356edb53b807c8f7c338aeff..0000000000000000000000000000000000000000 --- a/content/docs-lite/zh/docs/Developerguide/PQprepare.md +++ /dev/null @@ -1,71 +0,0 @@ -# PQprepare - -## 功能描述 - -用给定的参数提交请求,创建一个预备语句,然后等待结束。 - -## 原型 - -``` -PGresult *PQprepare(PGconn *conn, - const char *stmtName, - const char *query, - int nParams, - const Oid *paramTypes); -``` - -## 参数 - -**表 1** PQprepare参数 - - - - - - - - - - - - - - - - - - - - - - -

关键字

-

参数说明

-

conn

-

指向包含链接的对象指针。

-

stmtName

-

需要执行的stmt名称。

-

query

-

需要执行的查询字符串。

-

nParams

-

参数个数。

-

paramTypes

-

声明参数类型的数组。

-
- -## 返回值 - -PGresult:包含查询结果的对象指针。 - -## 注意事项 - -- PQprepare创建一个为PQexecPrepared执行用的预备语句,本特性支持命令的重复执行,不需要每次都进行解析和规划。PQprepare仅在协议3.0及以后的连接中支持,使用协议2.0时,PQprepare将失败。 -- 该函数从查询字符串创建一个名为stmtName的预备语句,该查询字符串必须包含一个SQL命令。stmtName可以是""来创建一个未命名的语句,在这种情况下,任何预先存在的未命名的语句都将被自动替换;否则,如果在当前会话中已经定义了语句名称,则这是一个错误。如果使用了任何参数,那么在查询中将它们称为$1,$2等。nParams是在paramTypes\[\]数组中预先指定类型的参数的数量。(当nParams为0时,数组指针可以为NULL)paramTypes\[\]通过OID指定要分配给参数符号的数据类型。如果paramTypes为NULL ,或者数组中的任何特定元素为零,服务器将按照对非类型化字面字符串的相同方式为参数符号分配数据类型。另外,查询可以使用数字高于nParams的参数符号;还将推断这些符号的数据类型。 - ->![](public_sys-resources/icon-notice.gif) **须知:** ->通过执行SQLPREPARE语句,还可以创建与PQexecPrepared一起使用的预备语句。此外,虽然没有用于删除预备语句的libpq函数,但是SQL DEALLOCATE语句可用于此目的。 - -## 示例 - -请参见[示例](示例-libpq.md)章节。 - diff --git a/content/docs-lite/zh/docs/Developerguide/PQreset.md b/content/docs-lite/zh/docs/Developerguide/PQreset.md deleted file mode 100644 index 8ebd3e62b767ea38d8830d7bc123f0566b692324..0000000000000000000000000000000000000000 --- a/content/docs-lite/zh/docs/Developerguide/PQreset.md +++ /dev/null @@ -1,39 +0,0 @@ -# PQreset - -## 功能描述 - -重置与服务器的通讯端口。 - -## 原型 - -``` -void PQreset(PGconn *conn); -``` - -## 参数 - -**表 1** PQreset参数 - - - - - - - - - - -

关键字

-

参数说明

-

conn

-

指向包含链接的对象指针。

-
- -## 注意事项 - -此函数将关闭与服务器的连接并且试图与同一个服务器重建新的连接,并使用所有前面使用过的参数。该函数在链接异常后进行故障恢复时十分有效。 - -## 示例 - -请参见[示例](示例-libpq.md)章节。 - diff --git a/content/docs-lite/zh/docs/Developerguide/PQresultStatus.md b/content/docs-lite/zh/docs/Developerguide/PQresultStatus.md deleted file mode 100644 index 509cc6bbe8007f299fa2139599e0bc4e06f46324..0000000000000000000000000000000000000000 --- a/content/docs-lite/zh/docs/Developerguide/PQresultStatus.md +++ /dev/null @@ -1,78 +0,0 @@ -# PQresultStatus - -## 功能描述 - -返回命令的结果状态。 - -## 原型 - -``` -ExecStatusType PQresultStatus(const PGresult *res); -``` - -## 参数 - -**表 1** PQresultStatus参数 - - - - - - - - - - -

关键字

-

参数说明

-

res

-

包含查询结果的对象指针。

-
- -## 返回值 - -PQresultStatus:命令执行结果的枚举,包括: - -``` -PQresultStatus可以返回下面数值之一: -PGRES_EMPTY_QUERY -发送给服务器的字串是空的。 - -PGRES_COMMAND_OK -成功完成一个不返回数据的命令。 - -PGRES_TUPLES_OK -成功执行一个返回数据的查询(比如SELECT或者SHOW)。 - -PGRES_COPY_OUT -(从服务器)Copy Out (拷贝出)数据传输开始。 - -PGRES_COPY_IN -Copy In(拷贝入)(到服务器)数据传输开始。 - -PGRES_BAD_RESPONSE -服务器的响应无法理解。 - -PGRES_NONFATAL_ERROR -发生了一个非致命错误(通知或者警告)。 - -PGRES_FATAL_ERROR -发生了一个致命错误。 - -PGRES_COPY_BOTH -拷贝入/出(到和从服务器)数据传输开始。这个特性当前只用于流复制, 所以这个状态不会在普通应用中发生。 - -PGRES_SINGLE_TUPLE -PGresult包含一个来自当前命令的结果元组。 这个状态只在查询选择了单行模式时发生 -``` - -## 注意事项 - -- 请注意,恰好检索到零行的SELECT命令仍然显示PGRES\_TUPLES\_OK。PGRES\_COMMAND\_OK用于永远不能返回行的命令(插入或更新,不带返回子句等)。PGRES\_EMPTY\_QUERY响应可能表明客户端软件存在bug。 - -- 状态为PGRES\_NONFATAL\_ERROR的结果永远不会由PQexec或其他查询执行函数直接返回,此类结果将传递给通知处理程序。 - -## 示例 - -请参见[示例](示例-libpq.md)章节。 - diff --git a/content/docs-lite/zh/docs/Developerguide/PQsendPrepare.md b/content/docs-lite/zh/docs/Developerguide/PQsendPrepare.md deleted file mode 100644 index 21de02eb288932552f0823f664800c79b98697a1..0000000000000000000000000000000000000000 --- a/content/docs-lite/zh/docs/Developerguide/PQsendPrepare.md +++ /dev/null @@ -1,67 +0,0 @@ -# PQsendPrepare - -## 功能描述 - -发送一个请求,创建一个给定参数的预备语句,而不等待结束。 - -## 原型 - -``` -int PQsendPrepare(PGconn *conn, - const char *stmtName, - const char *query, - int nParams, - const Oid *paramTypes); -``` - -## 参数 - -**表 1** PQsendPrepare参数 - - - - - - - - - - - - - - - - - - - - - - -

关键字

-

参数说明

-

conn

-

指向包含链接的对象指针。

-

stmtName

-

需要执行的stmt名称。

-

query

-

需要执行的查询字符串。

-

nParams

-

参数个数。

-

paramTypes

-

声明参数类型的数组。

-
- -## 返回值 - -int:执行结果为1表示成功,0表示失败,失败原因存到conn-\>errorMessage中。 - -## 注意事项 - -该函数为PQprepare的异步版本:如果能够分派请求,则返回1,否则返回0。调用成功后,调用PQgetResult判断服务端是否成功创建了preparedStatement。函数的参数与PQprepare一样处理。与PQprepare一样,它也不能在2.0协议的连接上工作。 - -## 示例 - -请参见[示例](示例-libpq.md)章节。 - diff --git a/content/docs-lite/zh/docs/Developerguide/PQsendQuery.md b/content/docs-lite/zh/docs/Developerguide/PQsendQuery.md deleted file mode 100644 index e7a076415ec75247ca2cf83e70f525903b2959bd..0000000000000000000000000000000000000000 --- a/content/docs-lite/zh/docs/Developerguide/PQsendQuery.md +++ /dev/null @@ -1,48 +0,0 @@ -# PQsendQuery - -## 功能描述 - -向服务器提交一个命令而不等待结果。如果查询成功发送则返回1,否则返回0。 - -## 原型 - -``` -int PQsendQuery(PGconn *conn, const char *command); -``` - -## 参数 - -**表 1** PQsendQuery参数 - - - - - - - - - - - - - -

关键字

-

参数说明

-

conn

-

指向包含链接的对象指针。

-

command

-

需要执行的查询字符串。

-
- -## 返回值 - -int:执行结果为1表示成功,0表示失败,失败原因存到conn-\>errorMessage中。 - -## 注意事项 - -在成功调用PQsendQuery后,调用PQgetResult一次或者多次获取结果。PQgetResult返回空指针表示命令已执行完成,否则不能再次调用PQsendQuery(在同一连接上)。 - -## 示例 - -请参见[示例](示例-libpq.md)章节。 - diff --git a/content/docs-lite/zh/docs/Developerguide/PQsendQueryParams.md b/content/docs-lite/zh/docs/Developerguide/PQsendQueryParams.md deleted file mode 100644 index f079ecffc3d0c9084d8e43a423de64978bb062f4..0000000000000000000000000000000000000000 --- a/content/docs-lite/zh/docs/Developerguide/PQsendQueryParams.md +++ /dev/null @@ -1,85 +0,0 @@ -# PQsendQueryParams - -## 功能描述 - -给服务器提交一个命令和分隔的参数,而不等待结果。 - -## 原型 - -``` -int PQsendQueryParams(PGconn *conn, - const char *command, - int nParams, - const Oid *paramTypes, - const char * const *paramValues, - const int *paramLengths, - const int *paramFormats, - int resultFormat); -``` - -## 参数 - -**表 1** PQsendQueryParams参数 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

关键字

-

参数说明

-

conn

-

指向包含链接的对象指针。

-

command

-

需要执行的查询字符串。

-

nParams

-

参数个数。

-

paramTypes

-

参数类型。

-

paramValues

-

参数值。

-

paramLengths

-

参数长度。

-

paramFormats

-

参数格式。

-

resultFormat

-

结果的格式。

-
- -## 返回值 - -int:执行结果为1表示成功,0表示失败,失败原因存到conn-\>errorMessage中。 - -## 注意事项 - -该函数等效于PQsendQuery,只是查询参数可以和查询字符串分开声明。函数的参数处理和PQexecParams一样,和PQexecParams类似,它不能在2.0版本的协议连接上工作,并且它只允许在查询字符串里出现一条命令。 - -## 示例 - -请参见[示例](示例-libpq.md)章节。 - diff --git a/content/docs-lite/zh/docs/Developerguide/PQsendQueryPrepared.md b/content/docs-lite/zh/docs/Developerguide/PQsendQueryPrepared.md deleted file mode 100644 index fb8604c695c0f629ae54c8dd0ecf0faa541e5033..0000000000000000000000000000000000000000 --- a/content/docs-lite/zh/docs/Developerguide/PQsendQueryPrepared.md +++ /dev/null @@ -1,79 +0,0 @@ -# PQsendQueryPrepared - -## 功能描述 - -发送一个请求执行带有给出参数的预备语句,不等待结果。 - -## 原型 - -``` -int PQsendQueryPrepared(PGconn *conn, - const char *stmtName, - int nParams, - const char * const *paramValues, - const int *paramLengths, - const int *paramFormats, - int resultFormat); -``` - -## 参数 - -**表 1** PQsendQueryPrepared参数 - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

关键字

-

参数说明

-

conn

-

指向包含链接信息的对象指针。

-

stmtName

-

需要执行的stmt名称。

-

nParams

-

参数个数。

-

paramValues

-

参数值。

-

paramLengths

-

参数长度。

-

paramFormats

-

参数格式。

-

resultFormat

-

结果的格式。

-
- -## 返回值 - -int:执行结果为1表示成功,0表示失败,失败原因存到conn-\>error\_message中。 - -## 注意事项 - -该函数类似于PQsendQueryParams,但是要执行的命令是通过命名一个预先准备的语句来指定的,而不是提供一个查询字符串。该函数的参数与PQexecPrepared一样处理。和PQexecPrepared一样,它也不能在2.0协议的连接上工作。 - -## 示例 - -请参见[示例](示例-libpq.md)章节。 - diff --git a/content/docs-lite/zh/docs/Developerguide/PQsetdbLogin.md b/content/docs-lite/zh/docs/Developerguide/PQsetdbLogin.md deleted file mode 100644 index 79e41c17c2d4d21914ba532ad43c50ac174c7aa9..0000000000000000000000000000000000000000 --- a/content/docs-lite/zh/docs/Developerguide/PQsetdbLogin.md +++ /dev/null @@ -1,80 +0,0 @@ -# PQsetdbLogin - -## 功能描述 - -与数据库服务器建立一个新的链接。 - -## 原型 - -``` -PGconn *PQsetdbLogin(const char *pghost, - const char *pgport, - const char *pgoptions, - const char *pgtty, - const char *dbName, - const char *login, - const char *pwd); -``` - -## 参数 - -**表 1** PQsetdbLogin参数 - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

关键字

-

参数说明

-

pghost

-

要链接的主机名,详见链接字符章节描述的host字段。

-

pgport

-

主机服务器的端口号,详见链接字符描述的port字段。

-

pgoptions

-

添加命令行选项以在运行时发送到服务器,详见链接字符描述的options字段。

-

pgtty

-

忽略(以前,这个选项声明服务器日志的输出方向)。

-

dbName

-

要链接的数据库名,详见链接字符描述的dbname字段。

-

login

-

要链接的用户名,详见链接字符章节描述的user字段。

-

pwd

-

如果服务器要求口令认证,所用的口令,详见链接字符描述的password字段。

-
- -## 返回值 - -PGconn \*:指向包含链接的对象指针,内存在函数内部申请。 - -## 注意事项 - -- 该函数为PQconnectdb前身,参数个数固定,未定义参数被调用时使用缺省值,若需要给固定参数设置缺省值,则可赋值NULL或者空字符串。 -- 若dbName中包含“=”或链接URL的有效前缀,则该dbName被看做一个conninfo字符串并传递至PQconnectdb中,其余参数与PQconnectdbParams保持一致。 - -## 示例 - -请参见[示例](示例-libpq.md)章节。 - diff --git a/content/docs-lite/zh/docs/Developerguide/PQstatus.md b/content/docs-lite/zh/docs/Developerguide/PQstatus.md deleted file mode 100644 index bed84e7ce0e33b062f46dd188f1ed150f430c1a7..0000000000000000000000000000000000000000 --- a/content/docs-lite/zh/docs/Developerguide/PQstatus.md +++ /dev/null @@ -1,69 +0,0 @@ -# PQstatus - -## 功能描述 - -返回链接的状态。 - -## 原型 - -``` -ConnStatusType PQstatus(const PGconn *conn); -``` - -## 参数 - -**表 1** PQstatus参数 - - - - - - - - - - -

关键字

-

参数说明

-

conn

-

指向包含链接的对象指针。

-
- -## 返回值 - -ConnStatusType:链接状态的枚举,包括: - -``` -CONNECTION_STARTED -等待进行连接。 - -CONNECTION_MADE -连接成功;等待发送。 - -CONNECTION_AWAITING_RESPONSE -等待来自服务器的响应。 - -CONNECTION_AUTH_OK -已收到认证;等待后端启动结束。 - -CONNECTION_SSL_STARTUP -协商SSL加密。 - -CONNECTION_SETENV -协商环境驱动的参数设置。 - -CONNECTION_OK -链接正常。 - -CONNECTION_BAD -链接故障。 -``` - -## 注意事项 - -状态可以是多个值之一。但是,在异步连接过程之外只能看到其中两个:CONNECTION\_OK和CONNECTION\_BAD。与数据库的良好连接状态为CONNECTION\_OK。与数据库的连接尝试失败为CONNECTION\_BAD。通常,“正常”状态将一直保持到PQfinish,但通信失败可能会导致状态CONNECTION\_BAD过早变为。在这种情况下,应用程序可以尝试通过调用进行恢复PQreset。 - -## 示例 - -请参见[示例](示例-libpq.md)章节。 - diff --git "a/content/docs-lite/zh/docs/Developerguide/Psycopg\345\214\205.md" "b/content/docs-lite/zh/docs/Developerguide/Psycopg\345\214\205.md" deleted file mode 100644 index 9c14b2b14b450b609066e641237bb8ca1b378967..0000000000000000000000000000000000000000 --- "a/content/docs-lite/zh/docs/Developerguide/Psycopg\345\214\205.md" +++ /dev/null @@ -1,9 +0,0 @@ -# Psycopg包 - -从发布包中获取,包名为openGauss-xxxx-操作系统版本号-64bit-Python.tar.gz。 - -解压后有两个文件夹: - -- psycopg2:psycopg2库文件。 -- lib:lib库文件。 - diff --git "a/content/docs-lite/zh/docs/Developerguide/Psycopg\346\216\245\345\217\243\345\217\202\350\200\203.md" "b/content/docs-lite/zh/docs/Developerguide/Psycopg\346\216\245\345\217\243\345\217\202\350\200\203.md" deleted file mode 100644 index e5d9681268fa243d69d9d5ec8171b826e96edf99..0000000000000000000000000000000000000000 --- "a/content/docs-lite/zh/docs/Developerguide/Psycopg\346\216\245\345\217\243\345\217\202\350\200\203.md" +++ /dev/null @@ -1,23 +0,0 @@ -# Psycopg接口参考 - -Psycopg接口是一套提供给用户的API方法,本节将对部分常用接口做具体描述。 - -- **[psycopg2.connect\(\)](psycopg2-connect.md)** - -- **[connection.cursor\(\)](connection-cursor.md)** - -- **[cursor.execute\(query,vars\_list\)](cursor-execute-query-vars_list.md)** - -- **[curosr.executemany\(query,vars\_list\)](curosr-executemany_query-vars_list.md)** - -- **[connection.commit\(\)](connection-commit.md)** - -- **[connection.rollback\(\)](connection-rollback.md)** - -- **[cursor.fetchone\(\)](cursor-fetchone.md)** - -- **[cursor.fetchall\(\)](cursor-fetchall.md)** - -- **[cursor.close\(\)](cursor-close.md)** - -- **[connection.close\(\)](connection-close.md)** \ No newline at end of file diff --git "a/content/docs-lite/zh/docs/Developerguide/SQL\347\274\226\345\206\231.md" "b/content/docs-lite/zh/docs/Developerguide/SQL\347\274\226\345\206\231.md" deleted file mode 100644 index 25316b925a0fe1235209ce481f5c74403330d8c8..0000000000000000000000000000000000000000 --- "a/content/docs-lite/zh/docs/Developerguide/SQL\347\274\226\345\206\231.md" +++ /dev/null @@ -1,158 +0,0 @@ -# SQL编写 - -## DDL - -- 【建议】在openGauss中,建议DDL(建表、comments等)操作统一执行,在批处理作业中尽量避免DDL操作。避免大量并发事务对性能的影响。 -- 【建议】在非日志表(unlogged table)使用完后,立即执行数据清理(truncate)操作。因为在异常场景下,openGauss不保证非日志表\(unlogged table\)数据的安全性。 -- 【建议】临时表和非日志表的存储方式建议和基表相同。当基表为行存(列存)表时,临时表和非日志表也推荐创建为行存(列存)表,可以避免行列混合关联带来的高计算代价。 -- 【建议】索引字段的总长度不超过50字节。否则,索引大小会膨胀比较严重,带来较大的存储开销,同时索引性能也会下降。 -- 【建议】不要使用DROP…CASCADE方式删除对象,除非已经明确对象间的依赖关系,以免误删。 - -## 数据加载和卸载 - -- 【建议】在insert语句中显式给出插入的字段列表。例如: - - ``` - INSERT INTO task(name,id,comment) VALUES ('task1','100','第100个任务'); - ``` - -- 【建议】在批量数据入库之后,或者数据增量达到一定阈值后,建议对表进行analyze操作,防止统计信息不准确而导致的执行计划劣化。 -- 【建议】如果要清理表中的所有数据,建议使用truncate table方式,不要使用delete table方式。delete table方式删除性能差,且不会释放那些已经删除了的数据占用的磁盘空间。 - -## 类型转换 - -- 【建议】在需要数据类型转换(不同数据类型进行比较或转换)时,使用强制类型转换,以防隐式类型转换结果与预期不符。 -- 【建议】在查询中,对常量要显式指定数据类型,不要试图依赖任何隐式的数据类型转换。 -- 【关注】若sql\_compatibility参数设置为A,在导入数据时,空字符串会自动转化为NULL。如果需要保留空字符串需要sql\_compatibility参数设置为C。 - -## 查询操作 - -- 【建议】除ETL程序外,应该尽量避免向客户端返回大量结果集的操作。如果结果集过大,应考虑业务设计是否合理。 -- 【建议】使用事务方式执行DDL和DML操作。例如,truncate table、update table、delete table、drop table等操作,一旦执行提交就无法恢复。对于这类操作,建议使用事务进行封装,必要时可以进行回滚。 -- 【建议】在查询编写时,建议明确列出查询涉及的所有字段,不建议使用“SELECT \*”这种写法。一方面基于性能考虑,尽量减少查询输出列;另一方面避免增删字段对前端业务兼容性的影响。 -- 【建议】在访问表对象时带上schema前缀,可以避免因schema切换导致访问到非预期的表。 -- 【建议】超过3张表或视图进行关联(特别是full join)时,执行代价难以估算。建议使用WITH TABLE AS语句创建中间临时表的方式增加SQL语句的可读性。 -- 【建议】尽量避免使用笛卡尔积和Full join。这些操作会造成结果集的急剧膨胀,同时其执行性能也很低。 -- 【关注】NULL值的比较只能使用IS NULL或者IS NOT NULL的方式判断,其他任何形式的逻辑判断都返回NULL。例如:NULL<\>NULL、NULL=NULL和NULL<\>1返回结果都是NULL,而不是期望的布尔值。 -- 【关注】需要统计表中所有记录数时,不要使用count\(col\)来替代count\(\*\)。count\(\*\)会统计NULL值(真实行数),而count\(col\)不会统计。 -- 【关注】在执行count\(col\)时,将“值为NULL”的记录行计数为0。在执行sum\(col\)时,当所有记录都为NULL时,最终将返回NULL;当不全为NULL时,“值为NULL”的记录行将被计数为0。 -- 【关注】count\(多个字段\)时,多个字段名必须用圆括号括起来。例如,count\( \(col1,col2,col3\) \)。注意:通过多字段统计行数时,即使所选字段都为NULL,该行也被计数,效果与count\(\*\)一致。 -- 【关注】count\(distinct col\)用来计算该列不重复的非NULL的数量,NULL将不被计数。 -- 【关注】count\(distinct \(col1,col2,...\)\)用来统计多列的唯一值数量,当所有统计字段都为NULL时,也会被计数,同时这些记录被认为是相同的。 -- 【建议】使用连接操作符“||”替换concat函数进行字符串连接。因为concat函数生成的执行计划不能下推,导致查询性能严重劣化。 -- 【建议】使用下面时间相关的宏替换now函数来获取当前时间。因为now函数生成的执行计划无法下推,导致查询性能严重劣化。 - - **表 1** 时间相关的宏 - - - - - - - - - - - - - - - - - - - - -

宏名称

-

描述

-

示例

-

CURRENT_DATE

-

获取当前日期,不包含时分秒。

-
openGauss=# select CURRENT_DATE;
-    date
-    ------------
-    2018-02-02
-    (1 row)
-

CURRENT_TIME

-

获取当前时间,不包含年月日。

-
openGauss=# select CURRENT_TIME;
-    timetz
-    --------------------
-    00:39:34.633938+08
-    (1 row)
-

CURRENT_TIMESTAMP(n)

-

获取当前日期和时间,包含年月日时分秒。

-
说明:

n表示存储的毫秒位数。

-
-
openGauss=# select CURRENT_TIMESTAMP(6);
-    timestamptz
-    -------------------------------
-    2018-02-02 00:39:55.231689+08
-    (1 row)
-
- -- 【建议】尽量避免标量子查询语句的出现。标量子查询是出现在select语句输出列表中的子查询,在下面例子中,下划线部分即为一个标量子查询语句: - - ``` - SELECT id, (SELECT COUNT(*) FROM films f WHERE f.did = s.id) FROM staffs_p1 s; - ``` - - 标量子查询往往会导致查询性能急剧劣化,在应用开发过程中,应当根据业务逻辑,对标量子查询进行等价转换,将其写为表关联。 - -- 【建议】在where子句中,应当对过滤条件进行排序,把选择读较小(筛选出的记录数较少)的条件排在前面。 -- 【建议】where子句中的过滤条件,尽量符合单边规则。即把字段名放在比较条件的一边,优化器在某些场景下会自动进行剪枝优化。形如col op expression,其中col为表的一个列,op为‘=’、‘\>’的等比较操作符,expression为不含列名的表达式。例如, - - ``` - SELECT id, from_image_id, from_person_id, from_video_id FROM face_data WHERE current_timestamp(6) - time < '1 days'::interval; - ``` - - 改写为: - - ``` - SELECT id, from_image_id, from_person_id, from_video_id FROM face_data where time > current_timestamp(6) - '1 days'::interval; - ``` - -- 【建议】尽量避免不必要的排序操作。排序需要耗费大量的内存及CPU,如果业务逻辑许可,可以组合使用order by和limit,减小资源开销。openGauss默认按照ASC & NULL LAST进行排序。 -- 【建议】使用ORDER BY子句进行排序时,显式指定排序方式(ASC/DESC),NULL的排序方式(NULL FIRST/NULL LAST)。 -- 【建议】不要单独依赖limit子句返回特定顺序的结果集。如果部分特定结果集,可以将ORDER BY子句与Limit子句组合使用,必要时也可以使用offset跳过特定结果。 -- 【建议】在保障业务逻辑准确的情况下,建议尽量使用UNION ALL来代替UNION。 -- 【建议】如果过滤条件只有OR表达式,可以将OR表达式转化为UNION ALL以提升性能。使用OR的SQL语句经常无法优化,导致执行速度慢。例如,将下面语句 - - ``` - SELECT * FROM scdc.pub_menu - WHERE (cdp= 300 AND inline=301) OR (cdp= 301 AND inline=302) OR (cdp= 302 ANDinline=301); - ``` - - 转换为: - - ``` - SELECT * FROM scdc.pub_menu - WHERE (cdp= 300 AND inline=301) - union all - SELECT * FROM scdc.pub_menu - WHERE (cdp= 301 AND inline=302) - union all - SELECT * FROM tablename - WHERE (cdp= 302 AND inline=301) - ``` - -- 【建议】当in\(val1, val2, val3…\)表达式中字段较多时,建议使用in \(values \(va11\), \(val2\),\(val3\)…\)语句进行替换。优化器会自动把in约束转换为非关联子查询,从而提升查询性能。 -- 【建议】在关联字段不存在NULL值的情况下,使用\(not\) exist代替\(not\) in。例如,在下面查询语句中,当T1.C1列不存在NULL值时,可以先为T1.C1字段添加NOT NULL约束,再进行如下改写。 - - ``` - SELECT * FROM T1 WHERE T1.C1 NOT IN (SELECT T2.C2 FROM T2); - ``` - - 可以改写为: - - ``` - SELECT * FROM T1 WHERE NOT EXISTS (SELECT * FROM T2 WHERE T1.C1=T2.C2); - ``` - - >![](public_sys-resources/icon-note.gif) **说明:** - > - >- 如果不能保证T1.C1列的值为NOT NULL的情况下,就不能进行上述改写。 - >- 如果T1.C1为子查询的输出,要根据业务逻辑确认其输出是否为NOT NULL。 - -- 【建议】通过游标进行翻页查询,而不是使用LIMIT OFFSET语法,避免多次执行带来的资源开销。游标必须在事务中使用,执行完后务必关闭游标并提交事务。 - diff --git "a/content/docs-lite/zh/docs/Developerguide/SQL\350\257\255\346\263\225\346\240\274\345\274\217\350\257\264\346\230\216.md" "b/content/docs-lite/zh/docs/Developerguide/SQL\350\257\255\346\263\225\346\240\274\345\274\217\350\257\264\346\230\216.md" deleted file mode 100644 index 5c03025c61667d749382fabba85b3acf3eff60bd..0000000000000000000000000000000000000000 --- "a/content/docs-lite/zh/docs/Developerguide/SQL\350\257\255\346\263\225\346\240\274\345\274\217\350\257\264\346\230\216.md" +++ /dev/null @@ -1,53 +0,0 @@ -# SQL语法格式说明 - -**表 1** SQL语法格式说明 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

格式

-

意义

-

[ ]

-

表示用“[ ]”括起来的部分是可选的。

-

...

-

表示前面的元素可重复出现。

-

[ x | y | ... ]

-

表示从两个或多个选项中选取一个或者不选。

-

{ x | y | ... }

-

表示从两个或多个选项中选取一个。

-

[x | y | ... ] [ ... ]

-

表示可选多个参数或者不选,如果选择多个参数,则参数之间用空格分隔。

-

[ x | y | ... ] [ ,... ]

-

表示可选多个参数或者不选,如果选择多个参数,则参数之间用逗号分隔。

-

{ x | y | ... } [ ... ]

-

表示可选多个参数,至少选一个,如果选择多个参数,则参数之间以空格分隔。

-

{ x | y | ... } [ ,... ]

-

表示可选多个参数,至少选一个,如果选择多个参数,则参数之间用逗号分隔。

-
\ No newline at end of file diff --git a/content/docs-lite/zh/docs/Developerguide/connection-close.md b/content/docs-lite/zh/docs/Developerguide/connection-close.md deleted file mode 100644 index b27c685a86b5376abc474b0c766ad1afca91e893..0000000000000000000000000000000000000000 --- a/content/docs-lite/zh/docs/Developerguide/connection-close.md +++ /dev/null @@ -1,27 +0,0 @@ -# connection.close\(\) - -## 功能描述 - -此方法关闭数据库连接。 - ->![](public_sys-resources/icon-caution.gif) **注意:** ->此方法关闭数据库连接,并不自动调用commit\(\)。如果只是关闭数据库连接而不调用commit\(\)方法,那么所有更改将会丢失。 - -## 原型 - -``` -connection.close() -``` - -## 参数 - -无。 - -## 返回值 - -无。 - -## 示例 - -请参见[示例:常用操作](示例-常用操作_Psycopg.md)。 - diff --git a/content/docs-lite/zh/docs/Developerguide/connection-commit.md b/content/docs-lite/zh/docs/Developerguide/connection-commit.md deleted file mode 100644 index a1eee3f28d638ceaf85e8b082a4a56ba6d1faa35..0000000000000000000000000000000000000000 --- a/content/docs-lite/zh/docs/Developerguide/connection-commit.md +++ /dev/null @@ -1,27 +0,0 @@ -# connection.commit\(\) - -## 功能描述 - -此方法将当前挂起的事务提交到数据库。 - ->![](public_sys-resources/icon-caution.gif) **注意:** ->默认情况下,Psycopg在执行第一个命令之前打开一个事务:如果不调用commit\(\),任何数据操作的效果都将丢失。 - -## 原型 - -``` -connection.commit() -``` - -## 参数 - -无。 - -## 返回值 - -无。 - -## 示例 - -请参见[示例:常用操作](示例-常用操作_Psycopg.md)。 - diff --git a/content/docs-lite/zh/docs/Developerguide/connection-cursor.md b/content/docs-lite/zh/docs/Developerguide/connection-cursor.md deleted file mode 100644 index ea738d7ba4c7ded608b1b4367f21506b4835fc12..0000000000000000000000000000000000000000 --- a/content/docs-lite/zh/docs/Developerguide/connection-cursor.md +++ /dev/null @@ -1,54 +0,0 @@ -# connection.cursor\(\) - -## 功能描述 - -此方法用于返回新的cursor对象。 - -## 原型 - -``` -cursor(name=None, cursor_factory=None, scrollable=None, withhold=False) -``` - -## 参数 - -**表 1** connection.cursor参数 - - - - - - - - - - - - - - - - - - - -

关键字

-

参数说明

-

name

-

cursor名称,默认为None。

-

cursor_factory

-

用于创造非标准cursor,默认为None。

-

scrollable

-

设置SCROLL选项,默认为None。

-

withhold

-

设置HOLD选项,默认为False。

-
- -## 返回值 - -cursor对象(用于整个数据库使用Python编程的cursor)。 - -## 示例 - -请参见[示例:常用操作](示例-常用操作_Psycopg.md)。 - diff --git a/content/docs-lite/zh/docs/Developerguide/connection-rollback.md b/content/docs-lite/zh/docs/Developerguide/connection-rollback.md deleted file mode 100644 index 6ce235abf9b46ce5b7d7ca82e42e9f242c18323d..0000000000000000000000000000000000000000 --- a/content/docs-lite/zh/docs/Developerguide/connection-rollback.md +++ /dev/null @@ -1,27 +0,0 @@ -# connection.rollback\(\) - -## 功能描述 - -此方法回滚当前挂起事务。 - ->![](public_sys-resources/icon-caution.gif) **注意:** ->执行关闭连接“close\(\)”而不先提交更改“commit\(\)”将导致执行隐式回滚。 - -## 原型 - -``` -connection.rollback() -``` - -## 参数 - -无。 - -## 返回值 - -无。 - -## 示例 - -请参见[示例:常用操作](示例-常用操作_Psycopg.md)。 - diff --git a/content/docs-lite/zh/docs/Developerguide/curosr-executemany_query-vars_list.md b/content/docs-lite/zh/docs/Developerguide/curosr-executemany_query-vars_list.md deleted file mode 100644 index 58dc735276cf45a79c90f4e685ba80ad612c43c9..0000000000000000000000000000000000000000 --- a/content/docs-lite/zh/docs/Developerguide/curosr-executemany_query-vars_list.md +++ /dev/null @@ -1,44 +0,0 @@ -# curosr.executemany\(query,vars\_list\) - -## 功能描述 - -此方法执行SQL命令所有参数序列或序列中的SQL映射。 - -## 原型 - -``` -curosr.executemany(query,vars_list) -``` - -## 参数 - -**表 1** curosr.executemany参数 - - - - - - - - - - - - - -

关键字

-

参数说明

-

query

-

待执行的SQL语句。

-

vars_list

-

变量列表,匹配query中%s占位符。

-
- -## 返回值 - -无 - -## 示例 - -请参见[示例:常用操作](示例-常用操作_Psycopg.md)。 - diff --git a/content/docs-lite/zh/docs/Developerguide/cursor-close.md b/content/docs-lite/zh/docs/Developerguide/cursor-close.md deleted file mode 100644 index 542a3f3a7f128c78f651275d7a61f2fd46094c9c..0000000000000000000000000000000000000000 --- a/content/docs-lite/zh/docs/Developerguide/cursor-close.md +++ /dev/null @@ -1,24 +0,0 @@ -# cursor.close\(\) - -## 功能描述 - -此方法关闭当前连接的游标。 - -## 原型 - -``` -cursor.close() -``` - -## 参数 - -无。 - -## 返回值 - -无。 - -## 示例 - -请参见[示例:常用操作](示例-常用操作_Psycopg.md)。 - diff --git a/content/docs-lite/zh/docs/Developerguide/cursor-execute-query-vars_list.md b/content/docs-lite/zh/docs/Developerguide/cursor-execute-query-vars_list.md deleted file mode 100644 index 8f4ed7fec51738f2a7aad54bc1b3cc51187d16cf..0000000000000000000000000000000000000000 --- a/content/docs-lite/zh/docs/Developerguide/cursor-execute-query-vars_list.md +++ /dev/null @@ -1,44 +0,0 @@ -# cursor.execute\(query,vars\_list\) - -## 功能描述 - -此方法执行被参数化的SQL语句(即占位符,而不是SQL文字)。psycopg2模块支持用%s标志的占位符。 - -## 原型 - -``` -curosr.execute(query,vars_list) -``` - -## 参数 - -**表 1** curosr.execute参数 - - - - - - - - - - - - - -

关键字

-

参数说明

-

query

-

待执行的sql语句。

-

vars_list

-

变量列表,匹配query中%s占位符。

-
- -## 返回值 - -无。 - -## 示例 - -请参见[示例:常用操作](示例-常用操作_Psycopg.md)。 - diff --git a/content/docs-lite/zh/docs/Developerguide/cursor-fetchall.md b/content/docs-lite/zh/docs/Developerguide/cursor-fetchall.md deleted file mode 100644 index 81c342238a5a2442753ac808470d98ddb3fdce67..0000000000000000000000000000000000000000 --- a/content/docs-lite/zh/docs/Developerguide/cursor-fetchall.md +++ /dev/null @@ -1,24 +0,0 @@ -# cursor.fetchall\(\) - -## 功能描述 - -此方法获取查询结果的所有(剩余)行,并将它们作为元组列表返回。 - -## 原型 - -``` -cursor.fetchall() -``` - -## 参数 - -无。 - -## 返回值 - -元组列表,为结果集的所有结果。空行时则返回空列表。 - -## 示例 - -请参见[示例:常用操作](示例-常用操作_Psycopg.md)。 - diff --git a/content/docs-lite/zh/docs/Developerguide/cursor-fetchone.md b/content/docs-lite/zh/docs/Developerguide/cursor-fetchone.md deleted file mode 100644 index 1646732316f3ef841db316912af19bddd8b7195a..0000000000000000000000000000000000000000 --- a/content/docs-lite/zh/docs/Developerguide/cursor-fetchone.md +++ /dev/null @@ -1,24 +0,0 @@ -# cursor.fetchone\(\) - -## 功能描述 - -此方法提取查询结果集的下一行,并返回一个元组。 - -## 原型 - -``` -cursor.fetchone() -``` - -## 参数 - -无。 - -## 返回值 - -单个元组,为结果集的第一条结果,当没有更多数据可用时,返回为“None”。 - -## 示例 - -请参见[示例:常用操作](示例-常用操作_Psycopg.md)。 - diff --git a/content/docs-lite/zh/docs/Developerguide/dblink.md b/content/docs-lite/zh/docs/Developerguide/dblink.md deleted file mode 100644 index bc0bba923690c1a6e2c2c6f53237a2c6c75bb738..0000000000000000000000000000000000000000 --- a/content/docs-lite/zh/docs/Developerguide/dblink.md +++ /dev/null @@ -1,309 +0,0 @@ -# dblink - -dblink是一个可以在openGauss数据库会话中连接到其它数据库的工具,同libpq支持的连接参数一致,可参考[链接参数](链接参数.md),也可以在通过在连接串中增加drivername字段连接异构数据库。openGauss默认不编译dblink,下面依次介绍如何编译和使用dblink。 - -## 编译dblink -当前dblink的源码放在[contrib/dblink](https://gitee.com/opengauss/openGauss-server/tree/master/contrib/dblink)目录中。在编译安装完openGauss数据库之后,如果用户需要使用dblink,只需要进入上述目录执行如下即可完成dblink的编译安装。 -请在编译安装dblink之前提前安装好ODBC驱动程序 - -``` -make -make install -``` - -## 常用的dblink函数 - - -参数 - -- conname 要使用的连接名。忽略这个参数将使用未命名连接。 - -- connstr 如之前为dblink_connect所描述的一个连接信息字符串。 - -- sql 在远程数据库中执行的SQL查询,例如select * from foo。 - -- fail_on_error 如果为真(忽略时的默认值),那么在连接的远端抛出的一个错误也会导致本地抛出一个错误。如果为假,远程错误只在本地被报告为一个 NOTICE,并且该函数不返回行。(只在通过libpq连接时候生效) - -函数 - -- 加载dblink扩展 - - ``` - CREATE EXTENSION dblink; - ``` - -- dblink_connect - - 描述:打开一个到远程数据库的持久连接 - - 返回值类型:text - - ``` - dblink_connect(text connstr) - dblink_connect(text connname, text connstr) - - SELECT dblink_connect('hostaddr=192.168.0.243 port=9876 dbname=postgres user=odbc password=abcdefg drivername=openGauss2'); - dblink_connect - ---------------- - OK - (1 row) - ``` - - - -- dblink_disconnect - - 描述:关闭一个到远程数据库的持久连接 - - 返回值类型:text - ``` - SELECT dblink_disconnect(); - SELECT dblink_disconnect(text connname); - - SELECT dblink_disconnect('test1'); - dblink_disconnect - ------------------- - OK - (1 row) - ``` - -- dblink - - 描述:在远程数据库执行select语句 - - 返回值类型 :record集合 - - 该函数返回查询产生的行。因为dblink能与任何查询一起使用,它被声明为返回record,而不是指定任意特定的列集合。这意味着你必须指定在调用的查询中所期望的列集合。 - - ``` - dblink(text connname, text sql [, bool fail_on_error]) - dblink(text connstr, text sql [, bool fail_on_error]) - dblink(text sql [, bool fail_on_error]) - - SELECT * FROM dblink('hostaddr=192.168.0.243 port=9876 dbname=postgres user=odbc password=abcdefg drivername=openGauss2', - 'select proname, prosrc from pg_proc') AS t1(proname name, prosrc text) WHERE proname LIKE 'bytea%'; - proname | prosrc - ------------+------------ - byteacat | byteacat - byteaeq | byteaeq - bytealt | bytealt - byteale | byteale - byteagt | byteagt - byteage | byteage - byteane | byteane - byteacmp | byteacmp - bytealike | bytealike - byteanlike | byteanlike - byteain | byteain - byteaout | byteaout - (12 rows) - ``` - -- dblink_exec - - 描述:在远程数据库执行非select语句 - - 返回值类型:text - - ``` - SELECT dblink_exec(text connname, text sql [, bool fail_on_error]) - SELECT dblink_exec(text connstr, text sql [, bool fail_on_error]) - SELECT dblink_exec(text sql [, bool fail_on_error]) - - SELECT dblink_exec('myconn', 'insert into foo values(21,''z'',''{"a0","b0","c0"}'');'); - dblink_exec - ---------------- - OK - (1 row) - ``` - -- dblink_open - - 描述:在一个远程数据库中打开一个游标 - - 返回值类型:text - ``` - SELECT dblink_open(text cursorname, text sql [, bool fail_on_error]) - SELECT dblink_open(text connname, text cursorname, text sql [, bool fail_on_error]) - - SELECT dblink_open('foo', 'select proname, prosrc from pg_proc'); - dblink_open - ------------- - OK - (1 row) - ``` -- dblink_fetch - - 描述:从一个远程数据库中的打开的游标返回行 - - 返回值类型:record集合 - - ``` - SELECT dblink_fetch(text cursorname, int howmany [, bool fail_on_error]) - SELECT dblink_fetch(text connname, text cursorname, int howmany [, bool fail_on_error]) - - SELECT * FROM dblink_fetch('foo', 5) AS (funcname name, source text); - funcname | source - ----------+---------- - byteacat | byteacat - byteacmp | byteacmp - byteaeq | byteaeq - byteage | byteage - byteagt | byteagt - (5 rows) - ``` -- dblink_close - - 描述:关闭一个远程数据库中的游标 - - 返回值类型:text - ``` - SELECT dblink_close(text cursorname [, bool fail_on_error]) - SELECT dblink_close(text connname, text cursorname [, bool fail_on_error]) - - SELECT dblink_close('foo'); - dblink_close - -------------- - OK - (1 row) - ``` - -- dblink_get_connections() - - 描述:返回所有打开的命名dblink连接的名称 - - 返回值类型:text 返回一个数组,其中是所有打开的命名dblink连接的名称。 - - ``` - SELECT dblink_get_connections() - - dblink_get_connections - ------------------------ - {b,a,pq} - (1 row) - ``` -- dblink_error_message - - 描述:得到在命名连接上的最后一个错误消息 - - 返回值类型:text - - ``` - SELECT dblink_error_message(text connname) - ``` - -- dblink_send_query - - 描述:发送一个异步查询到远程数据库 - - 返回值类型:int 成功返回1,失败返回0 - - ``` - SELECT dblink_send_query(text connname, text sql) - SELECT dblink_send_query('dtest1', 'SELECT * FROM foo WHERE f1 < 3'); - ``` - -- dblink_is_busy - - 描述:检查连接是否正在忙于一个异步查询 - - 返回值类型:int 连接正忙返回1,不忙返回0 - - ``` - SELECT dblink_is_busy(text connname) - ``` -- dblink_get_notify - - 描述:在一个连接上检索异步通知 - - dblink_get_notify在一个未命名连接或者一个指定的命名连接上检索通知。要通过 dblink 接收通知,首先必须使用dblink_exec发出LISTEN - - 返回值类型:集合 - ``` - SELECT dblink_get_notify() - SELECT dblink_get_notify(text connname) - - SELECT dblink_exec('LISTEN virtual'); - dblink_exec - ------------- - LISTEN - (1 row) - - SELECT * FROM dblink_get_notify(); - notify_name | be_pid | extra - -------------+--------+------- - (0 rows) - - NOTIFY virtual; - NOTIFY - - SELECT * FROM dblink_get_notify(); - notify_name | be_pid | extra - -------------+--------+------- - virtual | 1229 | - (1 row) - ``` -- dblink_get_result - - 描述:收集之前dblink_send_query发送的一个异步查询的结果。如果该查询还没有完成,dblink_get_result将等待直到它完成。 - - 返回值类型:record集合 - - ``` - SELECT dblink_get_result(text connname [, bool fail_on_error]) - - contrib_regression=# SELECT * FROM - contrib_regression-# dblink_send_query('dtest1', 'select * from foo where f1 < 3; select * from foo where f1 > 6') AS t1; - t1 - ---- - 1 - (1 row) - - contrib_regression=# SELECT * FROM dblink_get_result('dtest1') AS t1(f1 int, f2 text, f3 text[]); - f1 | f2 | f3 - ----+----+------------ - 0 | a | {a0,b0,c0} - 1 | b | {a1,b1,c1} - 2 | c | {a2,b2,c2} - (3 rows) - ``` -- dblink_cancel_query - - 描述:在命名连接上取消任何活动查询 - - 返回值类型:text - - ``` - SELECT dblink_cancel_query(text connname) - ``` -- dblink_get_drivername - - 描述:从odbc.ini中找到已配置的驱动名称 - - 返回值类型:text - - ``` - SELECT dblink_get_drivername - - SELECT dblink_get_drivername; - dblink_get_drivername - ---------------- - openGsuss,openGauss2 - (1 row) - ``` - -- 删除扩展 - - ``` - DROP EXTENSION dblink; - ``` - - -## 注意事项 - -- 目前dblink支持通过odbc连接所有支持odbc的异构数据库,以及通过libpq连接opengauss数据库。 -- 判断odbc或者libpq的条件为connstr中的drivername字段,存在drivername通过odbc连接,不存在drivername通过libpq连接,通过odbc连接只需指定用户名,密码,驱动名称三个参数即可,其他参数不生效。 -- 目前dblink暂时不支持线程池模式。 -- dblink_open,dblink_fetch,dblink_close 三个关于游标使用的函数,本质上为提前组装SQL语句,然后通过exec执行,因不同数据库语法有差异,不兼容的情况下,请通过dblink_exec来手动执行SQL控制游标。在通过odbc连接openGauss时,请自行通过dblink_exec打开/关闭事务。 -- dblink异步执行系列函数请务必执行正确的SQL语句,否则可能会导致异步执行函数异常。 -- 因openGauss与postgressql依赖冲突,暂时无法连接至postgresql数据库。 \ No newline at end of file diff --git "a/content/docs-lite/zh/docs/Developerguide/figures/12-4-5-4-\347\256\227\345\255\220\347\272\247\350\260\203\344\274\230(\347\244\272\344\276\213\351\224\231\344\271\261\350\260\203\346\225\2641\357\274\211.png" "b/content/docs-lite/zh/docs/Developerguide/figures/12-4-5-4-\347\256\227\345\255\220\347\272\247\350\260\203\344\274\230(\347\244\272\344\276\213\351\224\231\344\271\261\350\260\203\346\225\2641\357\274\211.png" deleted file mode 100644 index ee33dbf9dd6ccf19865b56ea38c9e0d6a3baf978..0000000000000000000000000000000000000000 Binary files "a/content/docs-lite/zh/docs/Developerguide/figures/12-4-5-4-\347\256\227\345\255\220\347\272\247\350\260\203\344\274\230(\347\244\272\344\276\213\351\224\231\344\271\261\350\260\203\346\225\2641\357\274\211.png" and /dev/null differ diff --git "a/content/docs-lite/zh/docs/Developerguide/figures/12-4-5-4-\347\256\227\345\255\220\347\272\247\350\260\203\344\274\230(\347\244\272\344\276\213\351\224\231\344\271\261\350\260\203\346\225\2642\357\274\211.png" "b/content/docs-lite/zh/docs/Developerguide/figures/12-4-5-4-\347\256\227\345\255\220\347\272\247\350\260\203\344\274\230(\347\244\272\344\276\213\351\224\231\344\271\261\350\260\203\346\225\2642\357\274\211.png" deleted file mode 100644 index 9c4d55dbcf2954250ae5bd83f4f8bb26ac6836ad..0000000000000000000000000000000000000000 Binary files "a/content/docs-lite/zh/docs/Developerguide/figures/12-4-5-4-\347\256\227\345\255\220\347\272\247\350\260\203\344\274\230(\347\244\272\344\276\213\351\224\231\344\271\261\350\260\203\346\225\2642\357\274\211.png" and /dev/null differ diff --git "a/content/docs-lite/zh/docs/Developerguide/figures/12-4-5-4-\347\256\227\345\255\220\347\272\247\350\260\203\344\274\230(\347\244\272\344\276\213\351\224\231\344\271\261\350\260\203\346\225\264\347\244\272\344\276\2133-1\357\274\211.png" "b/content/docs-lite/zh/docs/Developerguide/figures/12-4-5-4-\347\256\227\345\255\220\347\272\247\350\260\203\344\274\230(\347\244\272\344\276\213\351\224\231\344\271\261\350\260\203\346\225\264\347\244\272\344\276\2133-1\357\274\211.png" deleted file mode 100644 index 34bf5f128566f8e6a0b21fb5d196a0d609351265..0000000000000000000000000000000000000000 Binary files "a/content/docs-lite/zh/docs/Developerguide/figures/12-4-5-4-\347\256\227\345\255\220\347\272\247\350\260\203\344\274\230(\347\244\272\344\276\213\351\224\231\344\271\261\350\260\203\346\225\264\347\244\272\344\276\2133-1\357\274\211.png" and /dev/null differ diff --git "a/content/docs-lite/zh/docs/Developerguide/figures/12-4-5-4-\347\256\227\345\255\220\347\272\247\350\260\203\344\274\230(\347\244\272\344\276\213\351\224\231\344\271\261\350\260\203\346\225\264\347\244\272\344\276\2133\357\274\211.png" "b/content/docs-lite/zh/docs/Developerguide/figures/12-4-5-4-\347\256\227\345\255\220\347\272\247\350\260\203\344\274\230(\347\244\272\344\276\213\351\224\231\344\271\261\350\260\203\346\225\264\347\244\272\344\276\2133\357\274\211.png" deleted file mode 100644 index 7f523a603a9560f7421d07faaea44dfc83cc188b..0000000000000000000000000000000000000000 Binary files "a/content/docs-lite/zh/docs/Developerguide/figures/12-4-5-4-\347\256\227\345\255\220\347\272\247\350\260\203\344\274\230(\347\244\272\344\276\213\351\224\231\344\271\261\350\260\203\346\225\264\347\244\272\344\276\2133\357\274\211.png" and /dev/null differ diff --git "a/content/docs-lite/zh/docs/Developerguide/figures/4\350\267\25796\346\240\270\346\234\215\345\212\241\345\231\250\346\200\247\350\203\275\345\237\272\345\207\206.png" "b/content/docs-lite/zh/docs/Developerguide/figures/4\350\267\25796\346\240\270\346\234\215\345\212\241\345\231\250\346\200\247\350\203\275\345\237\272\345\207\206.png" deleted file mode 100644 index 51dc386cb093b658ba9ea1df6d27a0b17eaa6326..0000000000000000000000000000000000000000 Binary files "a/content/docs-lite/zh/docs/Developerguide/figures/4\350\267\25796\346\240\270\346\234\215\345\212\241\345\231\250\346\200\247\350\203\275\345\237\272\345\207\206.png" and /dev/null differ diff --git "a/content/docs-lite/zh/docs/Developerguide/figures/8\350\267\257384\346\240\270x86\346\234\215\345\212\241\345\231\250\346\200\247\350\203\275\345\237\272\345\207\206.png" "b/content/docs-lite/zh/docs/Developerguide/figures/8\350\267\257384\346\240\270x86\346\234\215\345\212\241\345\231\250\346\200\247\350\203\275\345\237\272\345\207\206.png" deleted file mode 100644 index b091b5692ec77610af717de7b9ab4a6202ccaf44..0000000000000000000000000000000000000000 Binary files "a/content/docs-lite/zh/docs/Developerguide/figures/8\350\267\257384\346\240\270x86\346\234\215\345\212\241\345\231\250\346\200\247\350\203\275\345\237\272\345\207\206.png" and /dev/null differ diff --git "a/content/docs-lite/zh/docs/Developerguide/figures/ARM\344\270\212\347\232\204TPC-C\357\274\210256\346\240\270\357\274\211.png" "b/content/docs-lite/zh/docs/Developerguide/figures/ARM\344\270\212\347\232\204TPC-C\357\274\210256\346\240\270\357\274\211.png" deleted file mode 100644 index 5a1658e9b0537821dcd69ea634aba762d7b2e5c8..0000000000000000000000000000000000000000 Binary files "a/content/docs-lite/zh/docs/Developerguide/figures/ARM\344\270\212\347\232\204TPC-C\357\274\210256\346\240\270\357\274\211.png" and /dev/null differ diff --git "a/content/docs-lite/zh/docs/Developerguide/figures/Arm-\351\262\262\351\271\2172\350\267\257128\346\240\270\346\200\247\350\203\275\345\237\272\345\207\206.png" "b/content/docs-lite/zh/docs/Developerguide/figures/Arm-\351\262\262\351\271\2172\350\267\257128\346\240\270\346\200\247\350\203\275\345\237\272\345\207\206.png" deleted file mode 100644 index 03b750929f62759423be45c2bdf6ec4b438f6cd0..0000000000000000000000000000000000000000 Binary files "a/content/docs-lite/zh/docs/Developerguide/figures/Arm-\351\262\262\351\271\2172\350\267\257128\346\240\270\346\200\247\350\203\275\345\237\272\345\207\206.png" and /dev/null differ diff --git "a/content/docs-lite/zh/docs/Developerguide/figures/Arm-\351\262\262\351\271\2172\350\267\257128\346\240\270\347\232\204\345\215\225\346\240\270\346\200\247\350\203\275\346\240\207\346\235\206.png" "b/content/docs-lite/zh/docs/Developerguide/figures/Arm-\351\262\262\351\271\2172\350\267\257128\346\240\270\347\232\204\345\215\225\346\240\270\346\200\247\350\203\275\346\240\207\346\235\206.png" deleted file mode 100644 index 081e6a32f42f556ed4a4fae7d043517a9c8ac1bc..0000000000000000000000000000000000000000 Binary files "a/content/docs-lite/zh/docs/Developerguide/figures/Arm-\351\262\262\351\271\2172\350\267\257128\346\240\270\347\232\204\345\215\225\346\240\270\346\200\247\350\203\275\346\240\207\346\235\206.png" and /dev/null differ diff --git "a/content/docs-lite/zh/docs/Developerguide/figures/Arm-\351\262\262\351\271\2174\350\267\257256\346\240\270\346\200\247\350\203\275\345\237\272\345\207\206.png" "b/content/docs-lite/zh/docs/Developerguide/figures/Arm-\351\262\262\351\271\2174\350\267\257256\346\240\270\346\200\247\350\203\275\345\237\272\345\207\206.png" deleted file mode 100644 index c840797a39dbffad351c8cb77e044df856a4f8f4..0000000000000000000000000000000000000000 Binary files "a/content/docs-lite/zh/docs/Developerguide/figures/Arm-\351\262\262\351\271\2174\350\267\257256\346\240\270\346\200\247\350\203\275\345\237\272\345\207\206.png" and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/EXECUTE-IMMEDIATE-dynamic_select_clause.png b/content/docs-lite/zh/docs/Developerguide/figures/EXECUTE-IMMEDIATE-dynamic_select_clause.png deleted file mode 100644 index 7c8ff4fe5b63750006d7cbda13fb09eb43153b21..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/EXECUTE-IMMEDIATE-dynamic_select_clause.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/EXISTS-NOT-EXISTS.png b/content/docs-lite/zh/docs/Developerguide/figures/EXISTS-NOT-EXISTS.png deleted file mode 100644 index e94b8279b0646be5f2ff8961f87a3da6132200fe..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/EXISTS-NOT-EXISTS.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/FOR_AS_loop.png b/content/docs-lite/zh/docs/Developerguide/figures/FOR_AS_loop.png deleted file mode 100644 index ffb95b0afd1cf65cfa2cda35bdf4e076f2bbc5b2..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/FOR_AS_loop.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/IF_THEN.jpg b/content/docs-lite/zh/docs/Developerguide/figures/IF_THEN.jpg deleted file mode 100644 index e0c994c47aff0233bc71499b6464a23a88e8b5f2..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/IF_THEN.jpg and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/IF_THEN_ELSE.jpg b/content/docs-lite/zh/docs/Developerguide/figures/IF_THEN_ELSE.jpg deleted file mode 100644 index a2f6cbe05da7a9847565189bdd4de6124e909571..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/IF_THEN_ELSE.jpg and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/IF_THEN_ELSIF_ELSE.png b/content/docs-lite/zh/docs/Developerguide/figures/IF_THEN_ELSIF_ELSE.png deleted file mode 100644 index 31630a879e9cfa8e5fcd057f096eb8d82bf59db6..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/IF_THEN_ELSIF_ELSE.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/IN-NOT-IN.png b/content/docs-lite/zh/docs/Developerguide/figures/IN-NOT-IN.png deleted file mode 100644 index 14447947244db073f027d1c9e97e3aca355d51b4..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/IN-NOT-IN.png and /dev/null differ diff --git "a/content/docs-lite/zh/docs/Developerguide/figures/MOT\346\236\266\346\236\204.png" "b/content/docs-lite/zh/docs/Developerguide/figures/MOT\346\236\266\346\236\204.png" deleted file mode 100644 index 2b07fb546f9f27b9a702ff18a4bbb73081f061b8..0000000000000000000000000000000000000000 Binary files "a/content/docs-lite/zh/docs/Developerguide/figures/MOT\346\236\266\346\236\204.png" and /dev/null differ diff --git "a/content/docs-lite/zh/docs/Developerguide/figures/SQL\345\274\225\346\223\216\346\211\247\350\241\214\346\237\245\350\257\242\347\261\273SQL\350\257\255\345\217\245\347\232\204\346\265\201\347\250\213.png" "b/content/docs-lite/zh/docs/Developerguide/figures/SQL\345\274\225\346\223\216\346\211\247\350\241\214\346\237\245\350\257\242\347\261\273SQL\350\257\255\345\217\245\347\232\204\346\265\201\347\250\213.png" deleted file mode 100644 index 4410b2f732fc457ffa33cbad382510c250837ccc..0000000000000000000000000000000000000000 Binary files "a/content/docs-lite/zh/docs/Developerguide/figures/SQL\345\274\225\346\223\216\346\211\247\350\241\214\346\237\245\350\257\242\347\261\273SQL\350\257\255\345\217\245\347\232\204\346\265\201\347\250\213.png" and /dev/null differ diff --git "a/content/docs-lite/zh/docs/Developerguide/figures/SQL\346\211\247\350\241\214\350\256\241\345\210\222\347\244\272\344\276\213.png" "b/content/docs-lite/zh/docs/Developerguide/figures/SQL\346\211\247\350\241\214\350\256\241\345\210\222\347\244\272\344\276\213.png" deleted file mode 100644 index fd252d899dfafcd02e17dbf5d6d2d021cc6f2b08..0000000000000000000000000000000000000000 Binary files "a/content/docs-lite/zh/docs/Developerguide/figures/SQL\346\211\247\350\241\214\350\256\241\345\210\222\347\244\272\344\276\213.png" and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/all.png b/content/docs-lite/zh/docs/Developerguide/figures/all.png deleted file mode 100644 index e98f64309e763640273d54fdafc11c2b10a07fff..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/all.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/anonymous_block.png b/content/docs-lite/zh/docs/Developerguide/figures/anonymous_block.png deleted file mode 100644 index 03a1b7fce4fd91051bd03bd391add89f62bb8375..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/anonymous_block.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/any-some.png b/content/docs-lite/zh/docs/Developerguide/figures/any-some.png deleted file mode 100644 index a9c566b94615d884c92cb7a6aa4212548c5446ee..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/any-some.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/assignment_value.png b/content/docs-lite/zh/docs/Developerguide/figures/assignment_value.png deleted file mode 100644 index 13c05e0886942c714f88dd0644e4432d232c62f7..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/assignment_value.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/call_anonymous_block.png b/content/docs-lite/zh/docs/Developerguide/figures/call_anonymous_block.png deleted file mode 100644 index a922995d474f54125c589d24412d1618741946de..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/call_anonymous_block.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/call_clause.png b/content/docs-lite/zh/docs/Developerguide/figures/call_clause.png deleted file mode 100644 index fa0f3c1b499be68f2b4f1f35b312c05b99834b2d..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/call_clause.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/call_procedure.png b/content/docs-lite/zh/docs/Developerguide/figures/call_procedure.png deleted file mode 100644 index cc33139552fe08c0814f78ec0fd7b60d3f32a581..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/call_procedure.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/case.jpg b/content/docs-lite/zh/docs/Developerguide/figures/case.jpg deleted file mode 100644 index a1c19617092c24a213aef5f0b06e7472ab9b3b42..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/case.jpg and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/case_when.png b/content/docs-lite/zh/docs/Developerguide/figures/case_when.png deleted file mode 100644 index ea133acf7eb8fd0537fbdc782838546bed1f1189..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/case_when.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/close_cursor.jpg b/content/docs-lite/zh/docs/Developerguide/figures/close_cursor.jpg deleted file mode 100644 index f8b55369321f416b7c9286966ea39b5965b66227..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/close_cursor.jpg and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/coalesce.png b/content/docs-lite/zh/docs/Developerguide/figures/coalesce.png deleted file mode 100644 index 681174f67ca9f63a0489ee649716ef3ca84f1004..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/coalesce.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/cursor_typename.png b/content/docs-lite/zh/docs/Developerguide/figures/cursor_typename.png deleted file mode 100644 index ff82ca8dcf75e4c40c7522d75c329e60fb356022..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/cursor_typename.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/declare_variable.png b/content/docs-lite/zh/docs/Developerguide/figures/declare_variable.png deleted file mode 100644 index 12a9342a08bf2a8777df3407fc296365c3b70e3b..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/declare_variable.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/decode.png b/content/docs-lite/zh/docs/Developerguide/figures/decode.png deleted file mode 100644 index bb6cd8c0b68ec844bb4b85ad90bdc4ab9c364824..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/decode.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/decode_type.png b/content/docs-lite/zh/docs/Developerguide/figures/decode_type.png deleted file mode 100644 index a610226347d362d34edd5423efadb0c0009fdbc0..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/decode_type.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/dynamic_cursor_define.png b/content/docs-lite/zh/docs/Developerguide/figures/dynamic_cursor_define.png deleted file mode 100644 index f7d670d9ac82638c749868c1f47c9fe6c93edb11..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/dynamic_cursor_define.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/fetch_cursor.png b/content/docs-lite/zh/docs/Developerguide/figures/fetch_cursor.png deleted file mode 100644 index 2e34d6892396bc589d07d2266a2ee46e66f16898..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/fetch_cursor.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/for_loop.png b/content/docs-lite/zh/docs/Developerguide/figures/for_loop.png deleted file mode 100644 index f4adee6a07aabb8fcc209386508b5e270130f32b..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/for_loop.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/for_loop_query.png b/content/docs-lite/zh/docs/Developerguide/figures/for_loop_query.png deleted file mode 100644 index 18fc66d6cf2dbc36e47c594ce47b48c9da569808..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/for_loop_query.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/forall.png b/content/docs-lite/zh/docs/Developerguide/figures/forall.png deleted file mode 100644 index 2e9d1bf610425ea143dedda6bb409a2bfbb9a0d0..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/forall.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/greatest.png b/content/docs-lite/zh/docs/Developerguide/figures/greatest.png deleted file mode 100644 index 666e005ee814d926ece5b3b368148a17f85146bd..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/greatest.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/least.png b/content/docs-lite/zh/docs/Developerguide/figures/least.png deleted file mode 100644 index b42a2f1f9c45e37dcbf7a2634f8d9e0404d13cc9..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/least.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/loop.png b/content/docs-lite/zh/docs/Developerguide/figures/loop.png deleted file mode 100644 index 4067af0ae6eff0896ecd4a7a44fbe675e61d64d0..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/loop.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/nested_assignment_value.png b/content/docs-lite/zh/docs/Developerguide/figures/nested_assignment_value.png deleted file mode 100644 index 9a0d0b450c1c3019f3043d183ac1aa5e67262465..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/nested_assignment_value.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/noselect.png b/content/docs-lite/zh/docs/Developerguide/figures/noselect.png deleted file mode 100644 index f66ce422fe2640d9e24b0b85ea461497f05568fc..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/noselect.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/nullif.png b/content/docs-lite/zh/docs/Developerguide/figures/nullif.png deleted file mode 100644 index 7b0e74363d02b682efe4cc63350c7ee514f80a79..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/nullif.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/nvl.jpg b/content/docs-lite/zh/docs/Developerguide/figures/nvl.jpg deleted file mode 100644 index 9c378ec205db7c788fa900344dbcc2aecb25f120..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/nvl.jpg and /dev/null differ diff --git "a/content/docs-lite/zh/docs/Developerguide/figures/openGauss\345\206\205\345\255\230\344\274\230\345\214\226\345\255\230\345\202\250\345\274\225\346\223\216.png" "b/content/docs-lite/zh/docs/Developerguide/figures/openGauss\345\206\205\345\255\230\344\274\230\345\214\226\345\255\230\345\202\250\345\274\225\346\223\216.png" deleted file mode 100644 index 8d353fb3803fad934e57f5a228d3657235c5a608..0000000000000000000000000000000000000000 Binary files "a/content/docs-lite/zh/docs/Developerguide/figures/openGauss\345\206\205\345\255\230\344\274\230\345\214\226\345\255\230\345\202\250\345\274\225\346\223\216.png" and /dev/null differ diff --git "a/content/docs-lite/zh/docs/Developerguide/figures/openGauss\345\206\205\347\275\256MOT\345\255\230\345\202\250\345\274\225\346\223\216-\345\244\226\351\203\250\346\225\260\346\215\256\345\272\223\347\232\204FDW\350\256\277\351\227\256.png" "b/content/docs-lite/zh/docs/Developerguide/figures/openGauss\345\206\205\347\275\256MOT\345\255\230\345\202\250\345\274\225\346\223\216-\345\244\226\351\203\250\346\225\260\346\215\256\345\272\223\347\232\204FDW\350\256\277\351\227\256.png" deleted file mode 100644 index 2b07fb546f9f27b9a702ff18a4bbb73081f061b8..0000000000000000000000000000000000000000 Binary files "a/content/docs-lite/zh/docs/Developerguide/figures/openGauss\345\206\205\347\275\256MOT\345\255\230\345\202\250\345\274\225\346\223\216-\345\244\226\351\203\250\346\225\260\346\215\256\345\272\223\347\232\204FDW\350\256\277\351\227\256.png" and /dev/null differ diff --git "a/content/docs-lite/zh/docs/Developerguide/figures/openGauss\346\200\247\350\203\275\350\260\203\344\274\230\346\265\201\347\250\213.png" "b/content/docs-lite/zh/docs/Developerguide/figures/openGauss\346\200\247\350\203\275\350\260\203\344\274\230\346\265\201\347\250\213.png" deleted file mode 100644 index 9d838ec08cb49a48643da1e551085da4d2e973f7..0000000000000000000000000000000000000000 Binary files "a/content/docs-lite/zh/docs/Developerguide/figures/openGauss\346\200\247\350\203\275\350\260\203\344\274\230\346\265\201\347\250\213.png" and /dev/null differ diff --git "a/content/docs-lite/zh/docs/Developerguide/figures/openGauss\346\234\215\345\212\241\345\223\215\345\272\224\346\265\201\347\250\213.jpg" "b/content/docs-lite/zh/docs/Developerguide/figures/openGauss\346\234\215\345\212\241\345\223\215\345\272\224\346\265\201\347\250\213.jpg" deleted file mode 100644 index ad6fb7bd992acfddba71c2b91a68a6b1caac5d16..0000000000000000000000000000000000000000 Binary files "a/content/docs-lite/zh/docs/Developerguide/figures/openGauss\346\234\215\345\212\241\345\223\215\345\272\224\346\265\201\347\250\213.jpg" and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/open_dynamic_cursor.png b/content/docs-lite/zh/docs/Developerguide/figures/open_dynamic_cursor.png deleted file mode 100644 index 8282aee18b8a9e3e20f51296677b84c2293d147a..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/open_dynamic_cursor.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/open_for.png b/content/docs-lite/zh/docs/Developerguide/figures/open_for.png deleted file mode 100644 index acfed7a343bdf302b0428b613ef2f94a0c9a4130..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/open_for.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/open_static_cursor.png b/content/docs-lite/zh/docs/Developerguide/figures/open_static_cursor.png deleted file mode 100644 index 52eed83654c09e7958c2a4cbd5da152b4afa810a..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/open_static_cursor.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/raise.png b/content/docs-lite/zh/docs/Developerguide/figures/raise.png deleted file mode 100644 index 85411be452cfb2aba72afd041e02139478b173d2..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/raise.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/raise_condition.png b/content/docs-lite/zh/docs/Developerguide/figures/raise_condition.png deleted file mode 100644 index a8f844c357e3a4bc0acecfe96938a35e8f6c568a..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/raise_condition.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/raise_format.png b/content/docs-lite/zh/docs/Developerguide/figures/raise_format.png deleted file mode 100644 index c278db49b518b0f9e52192cc4aa5ad66fa1e646d..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/raise_format.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/raise_option.png b/content/docs-lite/zh/docs/Developerguide/figures/raise_option.png deleted file mode 100644 index 2c28d3c5ffa7084dc29383b525d4a3eb7e99db8d..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/raise_option.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/raise_sqlstate.png b/content/docs-lite/zh/docs/Developerguide/figures/raise_sqlstate.png deleted file mode 100644 index 6b9d3c19e90890ca0f889a13db0393c708e1e614..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/raise_sqlstate.png and /dev/null differ diff --git "a/content/docs-lite/zh/docs/Developerguide/figures/record\347\261\273\345\236\213\347\232\204\350\257\255\346\263\225.png" "b/content/docs-lite/zh/docs/Developerguide/figures/record\347\261\273\345\236\213\347\232\204\350\257\255\346\263\225.png" deleted file mode 100644 index 339ec5a43417ec3331fd06ca60e23342e75f2a7a..0000000000000000000000000000000000000000 Binary files "a/content/docs-lite/zh/docs/Developerguide/figures/record\347\261\273\345\236\213\347\232\204\350\257\255\346\263\225.png" and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/return_clause.jpg b/content/docs-lite/zh/docs/Developerguide/figures/return_clause.jpg deleted file mode 100644 index 41ee83fd8a4f819aa088be9e06cd028c5e35db6c..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/return_clause.jpg and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/static_cursor_define.jpg b/content/docs-lite/zh/docs/Developerguide/figures/static_cursor_define.jpg deleted file mode 100644 index 5150409e5b3c37d82c777137d2bce68ff17df664..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/static_cursor_define.jpg and /dev/null differ diff --git "a/content/docs-lite/zh/docs/Developerguide/figures/tpmC-\345\257\271\346\257\224CPU\344\275\277\347\224\250\347\216\207.png" "b/content/docs-lite/zh/docs/Developerguide/figures/tpmC-\345\257\271\346\257\224CPU\344\275\277\347\224\250\347\216\207.png" deleted file mode 100644 index 6011acbea8d2d281a4a5191ef8451032d5f2b470..0000000000000000000000000000000000000000 Binary files "a/content/docs-lite/zh/docs/Developerguide/figures/tpmC-\345\257\271\346\257\224CPU\344\275\277\347\224\250\347\216\207.png" and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/using_clause-0.png b/content/docs-lite/zh/docs/Developerguide/figures/using_clause-0.png deleted file mode 100644 index 95fd0c9fc8230f3db6f343a3213d7623b9f4fc77..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/using_clause-0.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/using_clause-1.png b/content/docs-lite/zh/docs/Developerguide/figures/using_clause-1.png deleted file mode 100644 index 8ce079a0d75d31435f76fcf094a7eb36bf172e69..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/using_clause-1.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/using_clause-2.png b/content/docs-lite/zh/docs/Developerguide/figures/using_clause-2.png deleted file mode 100644 index 8ce079a0d75d31435f76fcf094a7eb36bf172e69..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/using_clause-2.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/using_clause.png b/content/docs-lite/zh/docs/Developerguide/figures/using_clause.png deleted file mode 100644 index d4d894a3f6ca61503cce2a7d9eac808b01bce590..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/using_clause.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/when_clause.png b/content/docs-lite/zh/docs/Developerguide/figures/when_clause.png deleted file mode 100644 index e03d843e350d381cc518fbbd18998f338b2ee88a..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/when_clause.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/while_loop.png b/content/docs-lite/zh/docs/Developerguide/figures/while_loop.png deleted file mode 100644 index 66506a24dd6442e143b554f5e8ef37501e612102..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/while_loop.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0000001144139135.png b/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0000001144139135.png deleted file mode 100644 index f5d5a3f8e8ee80b2c4d49cc73f1f676e96739d42..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0000001144139135.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0000001156347657.png b/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0000001156347657.png deleted file mode 100644 index 13a4dd9fb1a8b97996d614dc810524708c684e77..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0000001156347657.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0000001209457383.png b/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0000001209457383.png deleted file mode 100644 index 6ada80d3e4b7cbec92138d82663760b43400a187..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0000001209457383.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0000001209615959.png b/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0000001209615959.png deleted file mode 100644 index 82fc606afeffb5a7151e79895b41e0b7baace85c..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0000001209615959.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0000001209735947.png b/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0000001209735947.png deleted file mode 100644 index 1b32df325827baeb66edf57df52fd99b5234f690..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0000001209735947.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0000001209736009.png b/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0000001209736009.png deleted file mode 100644 index 4f4ce45883737219627bf9f6254e8ad868077ed1..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0000001209736009.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0118861065.jpg b/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0118861065.jpg deleted file mode 100644 index 9bbeac003592a2cf52c838e108b4978d903b5ad3..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0118861065.jpg and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289899860.png b/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289899860.png deleted file mode 100644 index 969810fa0ee1f30460d406ce997366f1d9ce1fd4..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289899860.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289899941.jpg b/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289899941.jpg deleted file mode 100644 index b7763b65de2c6f6a8fae3427b42e9c6c7ab524fd..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289899941.jpg and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289899947.png b/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289899947.png deleted file mode 100644 index 6bd563ba8a98381bc23ce90a508ded1395e2aa83..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289899947.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289899953.png b/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289899953.png deleted file mode 100644 index 7b284ed983b4b71cde110a9d7ae552c11ecd1f25..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289899953.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289899960.png b/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289899960.png deleted file mode 100644 index 47e12b2de48917db7703aca995231e56995daced..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289899960.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289899972.png b/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289899972.png deleted file mode 100644 index 34ee63b8e7ca84c24a46ec9257d00e11985998fd..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289899972.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289899975.png b/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289899975.png deleted file mode 100644 index 7aad3aefaabd51111ef2ef922fb38d088a454ba2..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289899975.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289899988.png b/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289899988.png deleted file mode 100644 index bbed7a77eed8a6eed3f9c2c958a6dd52941696fa..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289899988.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289899998.png b/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289899998.png deleted file mode 100644 index 8fc6f91809895bfa1f69c6fc34600ab675686901..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289899998.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289899999.png b/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289899999.png deleted file mode 100644 index 069d09f018ebb9d24d11603941aee4987e4df724..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289899999.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900038.png b/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900038.png deleted file mode 100644 index 184f2248d2e037ab50f46851273143c2fb95a904..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900038.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900085.png b/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900085.png deleted file mode 100644 index f4d46d9dbb5402adfa07bdc2eb6c1298013c1732..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900085.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900100.png b/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900100.png deleted file mode 100644 index 4a2ff4e441666446f154811420da438878011543..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900100.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900154.png b/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900154.png deleted file mode 100644 index eb0a64cffd30bda3e25f1f52b7695c9b55c1199f..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900154.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900162.png b/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900162.png deleted file mode 100644 index 058a79dd9fb3da7d5b74f799b4553b560ba87998..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900162.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900165.png b/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900165.png deleted file mode 100644 index 1e1a413adb4bc8df9e6b489e2f6917d3c7343f78..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900165.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900225.png b/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900225.png deleted file mode 100644 index abe13f437c2d129d4c900dacf835c383813c7045..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900225.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900286.png b/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900286.png deleted file mode 100644 index 51d704af108d7894dc27c0ccab6c14d8910bf967..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900286.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900287.png b/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900287.png deleted file mode 100644 index b180446c80d35137031f1fcce446101cdb50c2ac..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900287.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900299.png b/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900299.png deleted file mode 100644 index 35508eb6ef278ccaac3b902b262391e5bb6a3552..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900299.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900329.png b/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900329.png deleted file mode 100644 index 9b3de93402ea18673de4bf73b4614e4155bedb3e..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900329.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900417.png b/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900417.png deleted file mode 100644 index c8b8167d67ed0337a0441c449aaa60e91f2b7398..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900417.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900420.png b/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900420.png deleted file mode 100644 index 7d2afd09c4f68689992e7063b097a7f79e2c03be..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900420.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900471.png b/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900471.png deleted file mode 100644 index b8c2716f9092286367989af4ff35649f88ca09f5..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900471.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900515.png b/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900515.png deleted file mode 100644 index a32856aa08e459ed0f51f8fcf4c2f51511c12095..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900515.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900517.png b/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900517.png deleted file mode 100644 index 69f157ffe2306cb88837aba31ef75b7397cd6ac6..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900517.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900584.png b/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900584.png deleted file mode 100644 index 3210b21a485aea2e1950c5d9cd0325aa9547aeec..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900584.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900596.png b/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900596.png deleted file mode 100644 index 2c6365af42d3612d881f78e0b47e783504627bdc..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900596.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900622.png b/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900622.png deleted file mode 100644 index 035210281b8a1fd46923c18896ac7a183f3bf631..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900622.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900642.png b/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900642.png deleted file mode 100644 index 1e97aa4eca7e89b2c8194c30c30ecebed0fc1d8d..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900642.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900697.png b/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900697.png deleted file mode 100644 index 8e8fdc24f85d10f15b6defabc8fa90d0b127c753..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900697.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900783.png b/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900783.png deleted file mode 100644 index 31fe671c5643be5375abfd9f83a9c6cb03e743f0..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900783.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900819.png b/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900819.png deleted file mode 100644 index d245d48dc07e2b01734e21ec1952e89fa9269bdb..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900819.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900841.png b/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900841.png deleted file mode 100644 index fb06b2b05dcc099bb0b4f53675cd187699411f98..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900841.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900927.png b/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900927.png deleted file mode 100644 index 511de3baaf353522deb5e2a991490aa17ec5f062..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900927.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900952.png b/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900952.png deleted file mode 100644 index fd252d899dfafcd02e17dbf5d6d2d021cc6f2b08..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900952.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900964.png b/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900964.png deleted file mode 100644 index c06357562295146fc62fa10deab2741a9be8335d..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289900964.png and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289901020.png b/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289901020.png deleted file mode 100644 index acd844a569e5efb89441376911e7d98de334a3c2..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/figures/zh-cn_image_0289901020.png and /dev/null differ diff --git "a/content/docs-lite/zh/docs/Developerguide/figures/\344\270\211\347\247\215\346\227\245\345\277\227\350\256\260\345\275\225\351\200\211\351\241\271.png" "b/content/docs-lite/zh/docs/Developerguide/figures/\344\270\211\347\247\215\346\227\245\345\277\227\350\256\260\345\275\225\351\200\211\351\241\271.png" deleted file mode 100644 index f66ea1842403058dbca1ff8247ae2a548523573b..0000000000000000000000000000000000000000 Binary files "a/content/docs-lite/zh/docs/Developerguide/figures/\344\270\211\347\247\215\346\227\245\345\277\227\350\256\260\345\275\225\351\200\211\351\241\271.png" and /dev/null differ diff --git "a/content/docs-lite/zh/docs/Developerguide/figures/\344\275\216\345\273\266\350\277\237\357\274\21090th-\344\272\213\345\212\241\345\271\263\345\235\207\357\274\211\346\200\247\350\203\275\345\237\272\345\207\206.png" "b/content/docs-lite/zh/docs/Developerguide/figures/\344\275\216\345\273\266\350\277\237\357\274\21090th-\344\272\213\345\212\241\345\271\263\345\235\207\357\274\211\346\200\247\350\203\275\345\237\272\345\207\206.png" deleted file mode 100644 index bc26ee55864645341dbf63afea45e79962afd577..0000000000000000000000000000000000000000 Binary files "a/content/docs-lite/zh/docs/Developerguide/figures/\344\275\216\345\273\266\350\277\237\357\274\21090th-\344\272\213\345\212\241\345\271\263\345\235\207\357\274\211\346\200\247\350\203\275\345\237\272\345\207\206.png" and /dev/null differ diff --git "a/content/docs-lite/zh/docs/Developerguide/figures/\344\275\216\345\273\266\350\277\237\357\274\21090th-\357\274\211\346\200\247\350\203\275\345\237\272\345\207\206.png" "b/content/docs-lite/zh/docs/Developerguide/figures/\344\275\216\345\273\266\350\277\237\357\274\21090th-\357\274\211\346\200\247\350\203\275\345\237\272\345\207\206.png" deleted file mode 100644 index 401066aaaa5f3b0342ccccecb8e9b7585d68f71c..0000000000000000000000000000000000000000 Binary files "a/content/docs-lite/zh/docs/Developerguide/figures/\344\275\216\345\273\266\350\277\237\357\274\21090th-\357\274\211\346\200\247\350\203\275\345\237\272\345\207\206.png" and /dev/null differ diff --git "a/content/docs-lite/zh/docs/Developerguide/figures/\344\277\256\346\224\271BIOS\350\256\276\347\275\256\357\274\2101\357\274\211.png" "b/content/docs-lite/zh/docs/Developerguide/figures/\344\277\256\346\224\271BIOS\350\256\276\347\275\256\357\274\2101\357\274\211.png" deleted file mode 100644 index bbef53553bf16c717528939b4dc59c8cc94653e4..0000000000000000000000000000000000000000 Binary files "a/content/docs-lite/zh/docs/Developerguide/figures/\344\277\256\346\224\271BIOS\350\256\276\347\275\256\357\274\2101\357\274\211.png" and /dev/null differ diff --git "a/content/docs-lite/zh/docs/Developerguide/figures/\344\277\256\346\224\271BIOS\350\256\276\347\275\256\357\274\2102\357\274\211.png" "b/content/docs-lite/zh/docs/Developerguide/figures/\344\277\256\346\224\271BIOS\350\256\276\347\275\256\357\274\2102\357\274\211.png" deleted file mode 100644 index 430dfa0ca3f4fa0190ce42b0e9419469855b8fed..0000000000000000000000000000000000000000 Binary files "a/content/docs-lite/zh/docs/Developerguide/figures/\344\277\256\346\224\271BIOS\350\256\276\347\275\256\357\274\2102\357\274\211.png" and /dev/null differ diff --git "a/content/docs-lite/zh/docs/Developerguide/figures/\345\206\267\345\220\257\345\212\250\346\227\266\351\227\264\346\200\247\350\203\275\345\237\272\345\207\206.png" "b/content/docs-lite/zh/docs/Developerguide/figures/\345\206\267\345\220\257\345\212\250\346\227\266\351\227\264\346\200\247\350\203\275\345\237\272\345\207\206.png" deleted file mode 100644 index 88e5a185d677a8009e2cf4bf2d8a6fccc586e836..0000000000000000000000000000000000000000 Binary files "a/content/docs-lite/zh/docs/Developerguide/figures/\345\206\267\345\220\257\345\212\250\346\227\266\351\227\264\346\200\247\350\203\275\345\237\272\345\207\206.png" and /dev/null differ diff --git "a/content/docs-lite/zh/docs/Developerguide/figures/\345\215\216\344\270\272TaiShan-2480-MOT-TPC-C\346\265\213\350\257\225\347\273\223\346\236\234.png" "b/content/docs-lite/zh/docs/Developerguide/figures/\345\215\216\344\270\272TaiShan-2480-MOT-TPC-C\346\265\213\350\257\225\347\273\223\346\236\234.png" deleted file mode 100644 index 5ee472c15d3467c54b6835a8db8f7b0c3751d81a..0000000000000000000000000000000000000000 Binary files "a/content/docs-lite/zh/docs/Developerguide/figures/\345\215\216\344\270\272TaiShan-2480-MOT-TPC-C\346\265\213\350\257\225\347\273\223\346\236\234.png" and /dev/null differ diff --git "a/content/docs-lite/zh/docs/Developerguide/figures/\345\215\225\344\272\213\345\212\241\346\227\245\345\277\227\350\256\260\345\275\225.png" "b/content/docs-lite/zh/docs/Developerguide/figures/\345\215\225\344\272\213\345\212\241\346\227\245\345\277\227\350\256\260\345\275\225.png" deleted file mode 100644 index d22b931405034fe6ab80f0a5e9e2030ecc4a69d6..0000000000000000000000000000000000000000 Binary files "a/content/docs-lite/zh/docs/Developerguide/figures/\345\215\225\344\272\213\345\212\241\346\227\245\345\277\227\350\256\260\345\275\225.png" and /dev/null differ diff --git "a/content/docs-lite/zh/docs/Developerguide/figures/\345\220\214\346\255\245\346\227\245\345\277\227\350\256\260\345\275\225.png" "b/content/docs-lite/zh/docs/Developerguide/figures/\345\220\214\346\255\245\346\227\245\345\277\227\350\256\260\345\275\225.png" deleted file mode 100644 index e04ea48dfb2c27b523d0dec503693fcf0307e0ec..0000000000000000000000000000000000000000 Binary files "a/content/docs-lite/zh/docs/Developerguide/figures/\345\220\214\346\255\245\346\227\245\345\277\227\350\256\260\345\275\225.png" and /dev/null differ diff --git "a/content/docs-lite/zh/docs/Developerguide/figures/\345\274\202\346\255\245\346\227\245\345\277\227\350\256\260\345\275\225.png" "b/content/docs-lite/zh/docs/Developerguide/figures/\345\274\202\346\255\245\346\227\245\345\277\227\350\256\260\345\275\225.png" deleted file mode 100644 index 994e2aef9796e099dba67ec718ff76059b4b1299..0000000000000000000000000000000000000000 Binary files "a/content/docs-lite/zh/docs/Developerguide/figures/\345\274\202\346\255\245\346\227\245\345\277\227\350\256\260\345\275\225.png" and /dev/null differ diff --git "a/content/docs-lite/zh/docs/Developerguide/figures/\346\215\225\350\216\267.png" "b/content/docs-lite/zh/docs/Developerguide/figures/\346\215\225\350\216\267.png" deleted file mode 100644 index 4334f18f5c64751dc7409ac1f936916139b7c976..0000000000000000000000000000000000000000 Binary files "a/content/docs-lite/zh/docs/Developerguide/figures/\346\215\225\350\216\267.png" and /dev/null differ diff --git "a/content/docs-lite/zh/docs/Developerguide/figures/\346\225\260\346\215\256\345\272\223\351\200\273\350\276\221\347\273\223\346\236\204\345\233\276.png" "b/content/docs-lite/zh/docs/Developerguide/figures/\346\225\260\346\215\256\345\272\223\351\200\273\350\276\221\347\273\223\346\236\204\345\233\276.png" deleted file mode 100644 index b7d2ae3a30c0369406f54dcaeaafd3bffc838552..0000000000000000000000000000000000000000 Binary files "a/content/docs-lite/zh/docs/Developerguide/figures/\346\225\260\346\215\256\345\272\223\351\200\273\350\276\221\347\273\223\346\236\204\345\233\276.png" and /dev/null differ diff --git "a/content/docs-lite/zh/docs/Developerguide/figures/\346\226\207\346\241\243.png" "b/content/docs-lite/zh/docs/Developerguide/figures/\346\226\207\346\241\243.png" deleted file mode 100644 index 6e36e524b43f5e2af65a54395c97b6a24aedf566..0000000000000000000000000000000000000000 Binary files "a/content/docs-lite/zh/docs/Developerguide/figures/\346\226\207\346\241\243.png" and /dev/null differ diff --git "a/content/docs-lite/zh/docs/Developerguide/figures/\346\237\245\347\234\213nvme\347\233\230\347\232\204\344\277\241\346\201\257.png" "b/content/docs-lite/zh/docs/Developerguide/figures/\346\237\245\347\234\213nvme\347\233\230\347\232\204\344\277\241\346\201\257.png" deleted file mode 100644 index 6d4c8f37321c77926a74566c4b855eede2ed257d..0000000000000000000000000000000000000000 Binary files "a/content/docs-lite/zh/docs/Developerguide/figures/\346\237\245\347\234\213nvme\347\233\230\347\232\204\344\277\241\346\201\257.png" and /dev/null differ diff --git "a/content/docs-lite/zh/docs/Developerguide/figures/\346\237\245\347\234\213\346\223\215\344\275\234\347\263\273\347\273\237\345\206\205\346\240\270PAGESIZE\347\232\204\345\200\274.png" "b/content/docs-lite/zh/docs/Developerguide/figures/\346\237\245\347\234\213\346\223\215\344\275\234\347\263\273\347\273\237\345\206\205\346\240\270PAGESIZE\347\232\204\345\200\274.png" deleted file mode 100644 index b6a6bf62f507a72d8853f54b3bbb5d7f834cef98..0000000000000000000000000000000000000000 Binary files "a/content/docs-lite/zh/docs/Developerguide/figures/\346\237\245\347\234\213\346\223\215\344\275\234\347\263\273\347\273\237\345\206\205\346\240\270PAGESIZE\347\232\204\345\200\274.png" and /dev/null differ diff --git "a/content/docs-lite/zh/docs/Developerguide/figures/\347\247\201\346\234\211\357\274\210\346\234\254\345\234\260\357\274\211\345\206\205\345\255\230\357\274\210\346\257\217\344\270\252\344\272\213\345\212\241\357\274\211\345\222\214\345\205\250\345\261\200\345\206\205\345\255\230\357\274\210\346\211\200\346\234\211\346\240\270\347\232\204\346\211\200\346\234\211\344\272\213\345\212\241\357\274\211.png" "b/content/docs-lite/zh/docs/Developerguide/figures/\347\247\201\346\234\211\357\274\210\346\234\254\345\234\260\357\274\211\345\206\205\345\255\230\357\274\210\346\257\217\344\270\252\344\272\213\345\212\241\357\274\211\345\222\214\345\205\250\345\261\200\345\206\205\345\255\230\357\274\210\346\211\200\346\234\211\346\240\270\347\232\204\346\211\200\346\234\211\344\272\213\345\212\241\357\274\211.png" deleted file mode 100644 index 20e40c29699300ec9a85f8c61f8c65a31d90dfd9..0000000000000000000000000000000000000000 Binary files "a/content/docs-lite/zh/docs/Developerguide/figures/\347\247\201\346\234\211\357\274\210\346\234\254\345\234\260\357\274\211\345\206\205\345\255\230\357\274\210\346\257\217\344\270\252\344\272\213\345\212\241\357\274\211\345\222\214\345\205\250\345\261\200\345\206\205\345\255\230\357\274\210\346\211\200\346\234\211\346\240\270\347\232\204\346\211\200\346\234\211\344\272\213\345\212\241\357\274\211.png" and /dev/null differ diff --git "a/content/docs-lite/zh/docs/Developerguide/figures/\347\273\204\346\217\220\344\272\244-\345\205\267\346\234\211NUMA\346\204\237\347\237\245.png" "b/content/docs-lite/zh/docs/Developerguide/figures/\347\273\204\346\217\220\344\272\244-\345\205\267\346\234\211NUMA\346\204\237\347\237\245.png" deleted file mode 100644 index 5af469d587a511ca4c053a1d9af8ec26791ab8b6..0000000000000000000000000000000000000000 Binary files "a/content/docs-lite/zh/docs/Developerguide/figures/\347\273\204\346\217\220\344\272\244-\345\205\267\346\234\211NUMA\346\204\237\347\237\245.png" and /dev/null differ diff --git "a/content/docs-lite/zh/docs/Developerguide/figures/\350\257\246\347\273\206\347\273\223\346\236\234\346\212\245\345\221\212.png" "b/content/docs-lite/zh/docs/Developerguide/figures/\350\257\246\347\273\206\347\273\223\346\236\234\346\212\245\345\221\212.png" deleted file mode 100644 index ae93dca9942d92f00c63bcbea882cdfadcf70f24..0000000000000000000000000000000000000000 Binary files "a/content/docs-lite/zh/docs/Developerguide/figures/\350\257\246\347\273\206\347\273\223\346\236\234\346\212\245\345\221\212.png" and /dev/null differ diff --git "a/content/docs-lite/zh/docs/Developerguide/figures/\350\265\204\346\272\220\345\210\251\347\224\250\347\216\207\346\200\247\350\203\275\345\237\272\345\207\206.png" "b/content/docs-lite/zh/docs/Developerguide/figures/\350\265\204\346\272\220\345\210\251\347\224\250\347\216\207\346\200\247\350\203\275\345\237\272\345\207\206.png" deleted file mode 100644 index 0c623e9a966aa16c3fa5f3dc4f049912d0524b40..0000000000000000000000000000000000000000 Binary files "a/content/docs-lite/zh/docs/Developerguide/figures/\350\265\204\346\272\220\345\210\251\347\224\250\347\216\207\346\200\247\350\203\275\345\237\272\345\207\206.png" and /dev/null differ diff --git "a/content/docs-lite/zh/docs/Developerguide/figures/\351\200\273\350\276\221\345\244\215\345\210\266.png" "b/content/docs-lite/zh/docs/Developerguide/figures/\351\200\273\350\276\221\345\244\215\345\210\266.png" deleted file mode 100644 index d519c5e716362e18af13aab23e84f123f30cebe4..0000000000000000000000000000000000000000 Binary files "a/content/docs-lite/zh/docs/Developerguide/figures/\351\200\273\350\276\221\345\244\215\345\210\266.png" and /dev/null differ diff --git "a/content/docs-lite/zh/docs/Developerguide/figures/\351\207\207\347\224\250JDBC\345\274\200\345\217\221\345\272\224\347\224\250\347\250\213\345\272\217\347\232\204\346\265\201\347\250\213.png" "b/content/docs-lite/zh/docs/Developerguide/figures/\351\207\207\347\224\250JDBC\345\274\200\345\217\221\345\272\224\347\224\250\347\250\213\345\272\217\347\232\204\346\265\201\347\250\213.png" deleted file mode 100644 index 884b9343d59ad1a297845d7c097bc6c9e3743f51..0000000000000000000000000000000000000000 Binary files "a/content/docs-lite/zh/docs/Developerguide/figures/\351\207\207\347\224\250JDBC\345\274\200\345\217\221\345\272\224\347\224\250\347\250\213\345\272\217\347\232\204\346\265\201\347\250\213.png" and /dev/null differ diff --git "a/content/docs-lite/zh/docs/Developerguide/figures/\351\207\207\347\224\250Psycopg2\345\274\200\345\217\221\345\272\224\347\224\250\347\250\213\345\272\217\347\232\204\346\265\201\347\250\213.png" "b/content/docs-lite/zh/docs/Developerguide/figures/\351\207\207\347\224\250Psycopg2\345\274\200\345\217\221\345\272\224\347\224\250\347\250\213\345\272\217\347\232\204\346\265\201\347\250\213.png" deleted file mode 100644 index 884b9343d59ad1a297845d7c097bc6c9e3743f51..0000000000000000000000000000000000000000 Binary files "a/content/docs-lite/zh/docs/Developerguide/figures/\351\207\207\347\224\250Psycopg2\345\274\200\345\217\221\345\272\224\347\224\250\347\250\213\345\272\217\347\232\204\346\265\201\347\250\213.png" and /dev/null differ diff --git "a/content/docs-lite/zh/docs/Developerguide/figures/\351\235\236\345\224\257\344\270\200\347\264\242\345\274\225.png" "b/content/docs-lite/zh/docs/Developerguide/figures/\351\235\236\345\224\257\344\270\200\347\264\242\345\274\225.png" deleted file mode 100644 index 5a477ffaeeefff46359d8297f616936bd0223b1a..0000000000000000000000000000000000000000 Binary files "a/content/docs-lite/zh/docs/Developerguide/figures/\351\235\236\345\224\257\344\270\200\347\264\242\345\274\225.png" and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/java-sql-CallableStatement.md b/content/docs-lite/zh/docs/Developerguide/java-sql-CallableStatement.md deleted file mode 100644 index e872b817d7ba51563358d8d8b4fb8c11c5d63c61..0000000000000000000000000000000000000000 --- a/content/docs-lite/zh/docs/Developerguide/java-sql-CallableStatement.md +++ /dev/null @@ -1,202 +0,0 @@ -# java.sql.CallableStatement - -java.sql.CallableStatement是存储过程执行接口。 - -**表 1** 对java.sql.CallableStatement的支持情况 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

方法名

-

返回值类型

-

支持JDBC 4

-

getArray(int parameterIndex)

-

Array

-

Yes

-

getBigDecimal(int parameterIndex)

-

BigDecimal

-

Yes

-

getBlob(int parameterIndex)

-

Blob

-

Yes

-

getBoolean(int parameterIndex)

-

boolean

-

Yes

-

getByte(int parameterIndex)

-

byte

-

Yes

-

getBytes(int parameterIndex)

-

byte[]

-

Yes

-

getClob(int parameterIndex)

-

Clob

-

Yes

-

getDate(int parameterIndex)

-

Date

-

Yes

-

getDate(int parameterIndex, Calendar cal)

-

Date

-

Yes

-

getDouble(int parameterIndex)

-

double

-

Yes

-

getFloat(int parameterIndex)

-

float

-

Yes

-

getInt(int parameterIndex)

-

int

-

Yes

-

getLong(int parameterIndex)

-

long

-

Yes

-

getObject(int parameterIndex)

-

Object

-

Yes

-

getObject(int parameterIndex, Class<T> type)

-

Object

-

Yes

-

getShort(int parameterIndex)

-

short

-

Yes

-

getSQLXML(int parameterIndex)

-

SQLXML

-

Yes

-

getString(int parameterIndex)

-

String

-

Yes

-

getNString(int parameterIndex)

-

String

-

Yes

-

getTime(int parameterIndex)

-

Time

-

Yes

-

getTime(int parameterIndex, Calendar cal)

-

Time

-

Yes

-

getTimestamp(int parameterIndex)

-

Timestamp

-

Yes

-

getTimestamp(int parameterIndex, Calendar cal)

-

Timestamp

-

Yes

-

registerOutParameter(int parameterIndex, int type)

-

void

-

Yes

-

wasNull()

-

Boolean

-

Yes

-
- - ->![](public_sys-resources/icon-note.gif) **说明:** -> ->- 不允许含有OUT参数的语句执行批量操作。 -> ->- 以下方法是从java.sql.Statement继承而来:close、execute、executeQuery、executeUpdate、getConnection、getResultSet、getUpdateCount、isClosed、setMaxRows 、 setFetchSize。 -> ->- 以下方法是从java.sql.PreparedStatement继承而来:addBatch、clearParameters、execute、executeQuery、executeUpdate、getMetaData、setBigDecimal、setBoolean、setByte、setBytes、setDate、setDouble、setFloat、setInt、setLong、setNull、setObject、setString、setTime、setTimestamp。 - diff --git a/content/docs-lite/zh/docs/Developerguide/java-sql-Connection.md b/content/docs-lite/zh/docs/Developerguide/java-sql-Connection.md deleted file mode 100644 index de4b1a3bd9510d9d31b8a797a474ee0c688efee7..0000000000000000000000000000000000000000 --- a/content/docs-lite/zh/docs/Developerguide/java-sql-Connection.md +++ /dev/null @@ -1,365 +0,0 @@ -# java.sql.Connection - -java.sql.Connection是数据库连接接口。 - -**表 1** 对java.sql.Connection接口的支持情况 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

方法名

-

返回值类型

-

支持JDBC 4

-

abort(Executor executor)

-

void

-

Yes

-

clearWarnings()

-

void

-

Yes

-

close()

-

void

-

Yes

-

commit()

-

void

-

Yes

-

createArrayOf​(String typeName, Object[] elements)

-

Array

-

Yes

-

createBlob()

-

Blob

-

Yes

-

createClob()

-

Clob

-

Yes

-

createSQLXML()

-

SQLXML

-

Yes

-

createStatement()

-

Statement

-

Yes

-

createStatement​(int resultSetType, int resultSetConcurrency)

-

Statement

-

Yes

-

createStatement​(int resultSetType, int resultSetConcurrency, int resultSetHoldability)

-

Statement

-

Yes

-

getAutoCommit()

-

Boolean

-

Yes

-

getCatalog()

-

String

-

Yes

-

getClientInfo()

-

Properties

-

Yes

-

getClientInfo(String name)

-

String

-

Yes

-

getHoldability()

-

int

-

Yes

-

getMetaData()

-

DatabaseMetaData

-

Yes

-

getNetworkTimeout()

-

int

-

Yes

-

getSchema()

-

String

-

Yes

-

getTransactionIsolation()

-

int

-

Yes

-

getTypeMap()

-

Map<String,​Class<?>>

-

Yes

-

getWarnings()

-

SQLWarning

-

Yes

-

isClosed()

-

Boolean

-

Yes

-

isReadOnly()

-

Boolean

-

Yes

-

isValid​(int timeout)

-

boolean

-

Yes

-

nativeSQL​(String sql)

-

String

-

Yes

-

prepareCall​(String sql)

-

CallableStatement

-

Yes

-

prepareCall​(String sql, int resultSetType, int resultSetConcurrency)

-

CallableStatement

-

Yes

-

prepareCall​(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)

-

CallableStatement

-

Yes

-

prepareStatement(String sql)

-

PreparedStatement

-

Yes

-

prepareStatement​(String sql, int autoGeneratedKeys)

-

PreparedStatement

-

Yes

-

prepareStatement​(String sql, int[] columnIndexes)

-

PreparedStatement

-

Yes

-

prepareStatement​(String sql, int resultSetType, int resultSetConcurrency)

-

PreparedStatement

-

Yes

-

prepareStatement​(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)

-

PreparedStatement

-

Yes

-

prepareStatement​(String sql, String[] columnNames)

-

PreparedStatement

-

Yes

-

releaseSavepoint​(Savepoint savepoint)

-

void

-

Yes

-

rollback()

-

void

-

Yes

-

rollback​(Savepoint savepoint)

-

void

-

Yes

-

setAutoCommit(boolean autoCommit)

-

void

-

Yes

-

setClientInfo(Properties properties)

-

void

-

Yes

-

setClientInfo(String name,String value)

-

void

-

Yes

-

setHoldability​(int holdability)

-

void

-

Yes

-

setNetworkTimeout​(Executor executor, int milliseconds)

-

void

-

Yes

-

setReadOnly​(boolean readOnly)

-

void

-

Yes

-

setSavepoint()

-

Savepoint

-

Yes

-

setSavepoint​(String name)

-

Savepoint

-

Yes

-

setSchema​(String schema)

-

void

-

Yes

-

setTransactionIsolation​(int level)

-

void

-

Yes

-

setTypeMap​(Map<String,​Class<?>> map)

-

void

-

Yes

-
- ->![](public_sys-resources/icon-notice.gif) **须知:** -> ->接口内部默认使用自动提交模式,若通过setAutoCommit\(false\)关闭自动提交,将会导致后面执行的语句都受到显式事务包裹,数据库中不支持事务中执行的语句不能在此模式下执行。 - diff --git a/content/docs-lite/zh/docs/Developerguide/java-sql-DatabaseMetaData.md b/content/docs-lite/zh/docs/Developerguide/java-sql-DatabaseMetaData.md deleted file mode 100644 index d82103346c300c8a6ec3167c82a5220d3c0a85d7..0000000000000000000000000000000000000000 --- a/content/docs-lite/zh/docs/Developerguide/java-sql-DatabaseMetaData.md +++ /dev/null @@ -1,1249 +0,0 @@ -# java.sql.DatabaseMetaData - -java.sql.DatabaseMetaData是数据库对象定义接口。 - -**表 1** 对java.sql.DatabaseMetaData的支持情况 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

方法名

-

返回值类型

-

支持JDBC 4

-

allProceduresAreCallable()

-

boolean

-

Yes

-

allTablesAreSelectable()

-

boolean

-

Yes

-

autoCommitFailureClosesAllResultSets()

-

boolean

-

Yes

-

dataDefinitionCausesTransactionCommit()

-

boolean

-

Yes

-

dataDefinitionIgnoredInTransactions()

-

boolean

-

Yes

-

deletesAreDetected​(int type)

-

boolean

-

Yes

-

doesMaxRowSizeIncludeBlobs()

-

boolean

-

Yes

-

generatedKeyAlwaysReturned()

-

boolean

-

Yes

-

getBestRowIdentifier​(String catalog, String schema, String table, int scope, boolean nullable)

-

ResultSet

-

Yes

-

getCatalogs()

-

ResultSet

-

Yes

-

getCatalogSeparator()

-

String

-

Yes

-

getCatalogTerm()

-

String

-

Yes

-

getClientInfoProperties()

-

ResultSet

-

Yes

-

getColumnPrivileges​(String catalog, String schema, String table, String columnNamePattern)

-

ResultSet

-

Yes

-

getConnection()

-

Connection

-

Yes

-

getCrossReference​(String parentCatalog, String parentSchema, String parentTable, String foreignCatalog, String foreignSchema, String foreignTable)

-

ResultSet

-

Yes

-

getDefaultTransactionIsolation()

-

int

-

Yes

-

getExportedKeys​(String catalog, String schema, String table)

-

ResultSet

-

Yes

-

getExtraNameCharacters()

-

String

-

Yes

-

getFunctionColumns​(String catalog, String schemaPattern, String functionNamePattern, String columnNamePattern)

-

ResultSet

-

Yes

-

getFunctions​(String catalog, String schemaPattern, String functionNamePattern)

-

ResultSet

-

Yes

-

getIdentifierQuoteString()

-

String

-

Yes

-

getImportedKeys​(String catalog, String schema, String table)

-

ResultSet

-

Yes

-

getIndexInfo​(String catalog, String schema, String table, boolean unique, boolean approximate)

-

ResultSet

-

Yes

-

getMaxBinaryLiteralLength()

-

int

-

Yes

-

getMaxCatalogNameLength()

-

int

-

Yes

-

getMaxCharLiteralLength()

-

int

-

Yes

-

getMaxColumnNameLength()

-

int

-

Yes

-

getMaxColumnsInGroupBy()

-

int

-

Yes

-

getMaxColumnsInIndex()

-

int

-

Yes

-

getMaxColumnsInOrderBy()

-

int

-

Yes

-

getMaxColumnsInSelect()

-

int

-

Yes

-

getMaxColumnsInTable()

-

int

-

Yes

-

getMaxConnections()

-

int

-

Yes

-

getMaxCursorNameLength()

-

int

-

Yes

-

getMaxIndexLength()

-

int

-

Yes

-

getMaxLogicalLobSize()

-

default long

-

Yes

-

getMaxProcedureNameLength()

-

int

-

Yes

-

getMaxRowSize()

-

int

-

Yes

-

getMaxSchemaNameLength()

-

int

-

Yes

-

getMaxStatementLength()

-

int

-

Yes

-

getMaxStatements()

-

int

-

Yes

-

getMaxTableNameLength()

-

int

-

Yes

-

getMaxTablesInSelect()

-

int

-

Yes

-

getMaxUserNameLength()

-

int

-

Yes

-

getNumericFunctions()

-

String

-

Yes

-

getPrimaryKeys​(String catalog, String schema, String table)

-

ResultSet

-

Yes

-

getPartitionTablePrimaryKeys​(String catalog, String schema, String table)

-

ResultSet

-

Yes

-

getProcedureColumns​(String catalog, String schemaPattern, String procedureNamePattern, String columnNamePattern)

-

ResultSet

-

Yes

-

getProcedures​(String catalog, String schemaPattern, String procedureNamePattern)

-

ResultSet

-

Yes

-

getProcedureTerm()

-

String

-

Yes

-

getSchemas()

-

ResultSet

-

Yes

-

getSchemas​(String catalog, String schemaPattern)

-

ResultSet

-

Yes

-

getSchemaTerm()

-

String

-

Yes

-

getSearchStringEscape()

-

String

-

Yes

-

getSQLKeywords()

-

String

-

Yes

-

getSQLStateType()

-

int

-

Yes

-

getStringFunctions()

-

String

-

Yes

-

getSystemFunctions()

-

String

-

Yes

-

getTablePrivileges​(String catalog, String schemaPattern, String tableNamePattern)

-

ResultSet

-

Yes

-

getTimeDateFunctions()

-

String

-

Yes

-

getTypeInfo()

-

ResultSet

-

Yes

-

getUDTs​(String catalog, String schemaPattern, String typeNamePattern, int[] types)

-

ResultSet

-

Yes

-

getURL()

-

String

-

Yes

-

getVersionColumns​(String catalog, String schema, String table)

-

ResultSet

-

Yes

-

insertsAreDetected​(int type)

-

boolean

-

Yes

-

locatorsUpdateCopy()

-

boolean

-

Yes

-

othersDeletesAreVisible​(int type)

-

boolean

-

Yes

-

othersInsertsAreVisible​(int type)

-

boolean

-

Yes

-

othersUpdatesAreVisible​(int type)

-

boolean

-

Yes

-

ownDeletesAreVisible​(int type)

-

boolean

-

Yes

-

ownInsertsAreVisible​(int type)

-

boolean

-

Yes

-

ownUpdatesAreVisible​(int type)

-

boolean

-

Yes

-

storesLowerCaseIdentifiers()

-

boolean

-

Yes

-

storesMixedCaseIdentifiers()

-

boolean

-

Yes

-

storesUpperCaseIdentifiers()

-

boolean

-

Yes

-

supportsBatchUpdates()

-

boolean

-

Yes

-

supportsCatalogsInDataManipulation()

-

boolean

-

Yes

-

supportsCatalogsInIndexDefinitions()

-

boolean

-

Yes

-

supportsCatalogsInPrivilegeDefinitions()

-

boolean

-

Yes

-

supportsCatalogsInProcedureCalls()

-

boolean

-

Yes

-

supportsCatalogsInTableDefinitions()

-

boolean

-

Yes

-

supportsCorrelatedSubqueries()

-

boolean

-

Yes

-

supportsDataDefinitionAndDataManipulationTransactions()

-

boolean

-

Yes

-

supportsDataManipulationTransactionsOnly()

-

boolean

-

Yes

-

supportsGetGeneratedKeys()

-

boolean

-

Yes

-

supportsMixedCaseIdentifiers()

-

boolean

-

Yes

-

supportsMultipleOpenResults()

-

boolean

-

Yes

-

supportsNamedParameters()

-

boolean

-

Yes

-

supportsOpenCursorsAcrossCommit()

-

boolean

-

Yes

-

supportsOpenCursorsAcrossRollback()

-

boolean

-

Yes

-

supportsOpenStatementsAcrossCommit()

-

boolean

-

Yes

-

supportsOpenStatementsAcrossRollback()

-

boolean

-

Yes

-

supportsPositionedDelete()

-

boolean

-

Yes

-

supportsPositionedUpdate()

-

boolean

-

Yes

-

supportsRefCursors()

-

boolean

-

Yes

-

supportsResultSetConcurrency​(int type, int concurrency)

-

boolean

-

Yes

-

supportsResultSetType​(int type)

-

boolean

-

Yes

-

supportsSchemasInIndexDefinitions()

-

boolean

-

Yes

-

supportsSchemasInPrivilegeDefinitions()

-

boolean

-

Yes

-

supportsSchemasInProcedureCalls()

-

boolean

-

Yes

-

supportsSchemasInTableDefinitions()

-

boolean

-

Yes

-

supportsSelectForUpdate()

-

boolean

-

Yes

-

supportsStatementPooling()

-

boolean

-

Yes

-

supportsStoredFunctionsUsingCallSyntax()

-

boolean

-

Yes

-

supportsStoredProcedures()

-

boolean

-

Yes

-

supportsSubqueriesInComparisons()

-

boolean

-

Yes

-

supportsSubqueriesInExists()

-

boolean

-

Yes

-

supportsSubqueriesInIns()

-

boolean

-

Yes

-

supportsSubqueriesInQuantifieds()

-

boolean

-

Yes

-

supportsTransactionIsolationLevel​(int level)

-

boolean

-

Yes

-

supportsTransactions()

-

boolean

-

Yes

-

supportsUnion()

-

boolean

-

Yes

-

supportsUnionAll()

-

boolean

-

Yes

-

updatesAreDetected​(int type)

-

boolean

-

Yes

-

getTables(String catalog, String schemaPattern, String tableNamePattern, String[] types)

-

ResultSet

-

Yes

-

getColumns(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern)

-

ResultSet

-

Yes

-

getTableTypes()

-

ResultSet

-

Yes

-

getUserName()

-

String

-

Yes

-

isReadOnly()

-

boolean

-

Yes

-

nullsAreSortedHigh()

-

boolean

-

Yes

-

nullsAreSortedLow()

-

boolean

-

Yes

-

nullsAreSortedAtStart()

-

boolean

-

Yes

-

nullsAreSortedAtEnd()

-

boolean

-

Yes

-

getDatabaseProductName()

-

String

-

Yes

-

getDatabaseProductVersion()

-

String

-

Yes

-

getDriverName()

-

String

-

Yes

-

getDriverVersion()

-

String

-

Yes

-

getDriverMajorVersion()

-

int

-

Yes

-

getDriverMinorVersion()

-

int

-

Yes

-

usesLocalFiles()

-

boolean

-

Yes

-

usesLocalFilePerTable()

-

boolean

-

Yes

-

supportsMixedCaseIdentifiers()

-

boolean

-

Yes

-

storesUpperCaseIdentifiers()

-

boolean

-

Yes

-

storesLowerCaseIdentifiers()

-

boolean

-

Yes

-

supportsMixedCaseQuotedIdentifiers()

-

boolean

-

Yes

-

storesUpperCaseQuotedIdentifiers()

-

boolean

-

Yes

-

storesLowerCaseQuotedIdentifiers()

-

boolean

-

Yes

-

storesMixedCaseQuotedIdentifiers()

-

boolean

-

Yes

-

supportsAlterTableWithAddColumn()

-

boolean

-

Yes

-

supportsAlterTableWithDropColumn()

-

boolean

-

Yes

-

supportsColumnAliasing()

-

boolean

-

Yes

-

nullPlusNonNullIsNull()

-

boolean

-

Yes

-

supportsConvert()

-

boolean

-

Yes

-

supportsConvert(int fromType, int toType)

-

boolean

-

Yes

-

supportsTableCorrelationNames()

-

boolean

-

Yes

-

supportsDifferentTableCorrelationNames()

-

boolean

-

Yes

-

supportsExpressionsInOrderBy()

-

boolean

-

Yes

-

supportsOrderByUnrelated()

-

boolean

-

Yes

-

supportsGroupBy()

-

boolean

-

Yes

-

supportsGroupByUnrelated()

-

boolean

-

Yes

-

supportsGroupByBeyondSelect()

-

boolean

-

Yes

-

supportsLikeEscapeClause()

-

boolean

-

Yes

-

supportsMultipleResultSets()

-

boolean

-

Yes

-

supportsMultipleTransactions()

-

boolean

-

Yes

-

supportsNonNullableColumns()

-

boolean

-

Yes

-

supportsMinimumSQLGrammar()

-

boolean

-

Yes

-

supportsCoreSQLGrammar()

-

boolean

-

Yes

-

supportsExtendedSQLGrammar()

-

boolean

-

Yes

-

supportsANSI92EntryLevelSQL()

-

boolean

-

Yes

-

supportsANSI92IntermediateSQL()

-

boolean

-

Yes

-

supportsANSI92FullSQL()

-

boolean

-

Yes

-

supportsIntegrityEnhancementFacility()

-

boolean

-

Yes

-

supportsOuterJoins()

-

boolean

-

Yes

-

supportsFullOuterJoins()

-

boolean

-

Yes

-

supportsLimitedOuterJoins()

-

boolean

-

Yes

-

isCatalogAtStart()

-

boolean

-

Yes

-

supportsSchemasInDataManipulation()

-

boolean

-

Yes

-

supportsSavepoints()

-

boolean

-

Yes

-

supportsResultSetHoldability(int holdability)

-

boolean

-

Yes

-

getResultSetHoldability()

-

int

-

Yes

-

getDatabaseMajorVersion()

-

int

-

Yes

-

getDatabaseMinorVersion()

-

int

-

Yes

-

getJDBCMajorVersion()

-

int

-

Yes

-

getJDBCMinorVersion()

-

int

-

Yes

-
->![](public_sys-resources/icon-caution.gif) **注意:** ->getPartitionTablePrimaryKeys​\(String catalog, String schema, String table\)接口用于获取分区表含全局索引的主键列,使用示例如下: ->``` ->PgDatabaseMetaData dbmd = (PgDatabaseMetaData)conn.getMetaData(); ->dbmd.getPartitionTablePrimaryKeys("catalogName", "schemaName", "tableName"); ->``` - diff --git a/content/docs-lite/zh/docs/Developerguide/java-sql-Driver.md b/content/docs-lite/zh/docs/Developerguide/java-sql-Driver.md deleted file mode 100644 index 25e3a4584cc590d9716d04687abd7a1bb41a485e..0000000000000000000000000000000000000000 --- a/content/docs-lite/zh/docs/Developerguide/java-sql-Driver.md +++ /dev/null @@ -1,67 +0,0 @@ -# java.sql.Driver - -java.sql.Driver是数据库驱动接口。 - -**表 1** 对java.sql.Driver的支持情况 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

方法名

-

返回值类型

-

支持JDBC 4

-

acceptsURL(String url)

-

Boolean

-

Yes

-

connect(String url, Properties info)

-

Connection

-

Yes

-

jdbcCompliant()

-

Boolean

-

Yes

-

getMajorVersion()

-

int

-

Yes

-

getMinorVersion()

-

int

-

Yes

-

getParentLogger()

-

Logger

-

Yes

-

getPropertyInfo​(String url, Properties info)

-

DriverPropertyInfo[]

-

Yes

-
- diff --git a/content/docs-lite/zh/docs/Developerguide/java-sql-PreparedStatement.md b/content/docs-lite/zh/docs/Developerguide/java-sql-PreparedStatement.md deleted file mode 100644 index 7deec235a445a81eb64a241a46d80b15ed23decd..0000000000000000000000000000000000000000 --- a/content/docs-lite/zh/docs/Developerguide/java-sql-PreparedStatement.md +++ /dev/null @@ -1,360 +0,0 @@ -# java.sql.PreparedStatement - -java.sql.PreparedStatement是预处理语句接口。 - -**表 1** 对java.sql.PreparedStatement的支持情况 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

方法名

-

返回值类型

-

支持JDBC 4

-

clearParameters()

-

void

-

Yes

-

execute()

-

Boolean

-

Yes

-

executeQuery()

-

ResultSet

-

Yes

-

excuteUpdate()

-

int

-

Yes

-

executeLargeUpdate()

-

long

-

No

-

getMetaData()

-

ResultSetMetaData

-

Yes

-

getParameterMetaData()

-

ParameterMetaData

-

Yes

-

setArray​(int parameterIndex, Array x)

-

void

-

Yes

-

setAsciiStream​(int parameterIndex, InputStream x, int length)

-

void

-

Yes

-

setBinaryStream​(int parameterIndex, InputStream x)

-

void

-

Yes

-

setBinaryStream​(int parameterIndex, InputStream x, int length)

-

void

-

Yes

-

setBinaryStream​(int parameterIndex, InputStream x, long length)

-

void

-

Yes

-

setBlob​(int parameterIndex, InputStream inputStream)

-

void

-

Yes

-

setBlob​(int parameterIndex, InputStream inputStream, long length)

-

void

-

Yes

-

setBlob​(int parameterIndex, Blob x)

-

void

-

Yes

-

setCharacterStream​(int parameterIndex, Reader reader)

-

void

-

Yes

-

setCharacterStream​(int parameterIndex, Reader reader, int length)

-

void

-

Yes

-

setClob​(int parameterIndex, Reader reader)

-

void

-

Yes

-

setClob​(int parameterIndex, Reader reader, long length)

-

void

-

Yes

-

setClob​(int parameterIndex, Clob x)

-

void

-

Yes

-

setDate​(int parameterIndex, Date x, Calendar cal)

-

void

-

Yes

-

setNull​(int parameterIndex, int sqlType)

-

void

-

Yes

-

setNull​(int parameterIndex, int sqlType, String typeName)

-

void

-

Yes

-

setObject​(int parameterIndex, Object x)

-

void

-

Yes

-

setObject​(int parameterIndex, Object x, int targetSqlType)

-

void

-

Yes

-

setObject​(int parameterIndex, Object x, int targetSqlType, int scaleOrLength)

-

void

-

Yes

-

setSQLXML​(int parameterIndex, SQLXML xmlObject)

-

void

-

Yes

-

setTime​(int parameterIndex, Time x)

-

void

-

Yes

-

setTime​(int parameterIndex, Time x, Calendar cal)

-

void

-

Yes

-

setTimestamp​(int parameterIndex, Timestamp x)

-

void

-

Yes

-

setTimestamp​(int parameterIndex, Timestamp x, Calendar cal)

-

void

-

Yes

-

setUnicodeStream(int parameterIndex, InputStream x, int length)

-

void

-

Yes

-

setURL(int parameterIndex, URL x)

-

void

-

Yes

-

setBoolean(int parameterIndex, boolean x)

-

void

-

Yes

-

setBigDecimal(int parameterIndex, BigDecimal x)

-

void

-

Yes

-

setByte(int parameterIndex, byte x)

-

void

-

Yes

-

setBytes(int parameterIndex, byte[] x)

-

void

-

Yes

-

setDate(int parameterIndex, Date x)

-

void

-

Yes

-

setDouble(int parameterIndex, double x)

-

void

-

Yes

-

setFloat(int parameterIndex, float x)

-

void

-

Yes

-

setInt(int parameterIndex, int x)

-

void

-

Yes

-

setLong(int parameterIndex, long x)

-

void

-

Yes

-

setShort(int parameterIndex, short x)

-

void

-

Yes

-

setString(int parameterIndex, String x)

-

void

-

Yes

-

setNString(int parameterIndex, String x)

-

void

-

Yes

-

addBatch()

-

void

-

Yes

-

executeBatch()

-

int[]

-

Yes

-
- - - ->![](public_sys-resources/icon-note.gif) **说明:** -> ->- addBatch\(\)、execute\(\)必须在clearBatch\(\)之后才能执行。 - ->- 调用executeBatch\(\)方法并不会清除batch。用户必须显式使用clearBatch\(\)清除 。 - ->- 在添加了一个batch的绑定变量后,用户若想重用这些值(再次添加一个batch),无需再次使用set\*\(\)方法 。 - ->- 以下方法是从java.sql.Statement继承而来:close、execute、executeQuery、executeUpdate、getConnection、getResultSet、getUpdateCount、isClosed、setMaxRows、setFetchSize。 - ->- executeLargeUpdate\(\)方法必须在JDBC4.2及以上使用。 - diff --git a/content/docs-lite/zh/docs/Developerguide/java-sql-ResultSet.md b/content/docs-lite/zh/docs/Developerguide/java-sql-ResultSet.md deleted file mode 100644 index 0a995562042b1c0891d4db204af06dcfbc5ac70e..0000000000000000000000000000000000000000 --- a/content/docs-lite/zh/docs/Developerguide/java-sql-ResultSet.md +++ /dev/null @@ -1,963 +0,0 @@ -# java.sql.ResultSet - -java.sql.ResultSet是执行结果集接口。 - -**表 1** 对java.sql.ResultSet的支持情况 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

方法名

-

返回值类型

-

支持JDBC 4

-

absolute​(int row)

-

Boolean

-

Yes

-

afterLast()

-

void

-

Yes

-

beforeFirst()

-

void

-

Yes

-

cancelRowUpdates()

-

void

-

Yes

-

clearWarnings()

-

void

-

Yes

-

close()

-

void

-

Yes

-

deleteRow()

-

void

-

Yes

-

findColumn(String columnLabel)

-

int

-

Yes

-

first()

-

Boolean

-

Yes

-

getArray​(int columnIndex)

-

Array

-

Yes

-

getArray​(String columnLabel)

-

Array

-

Yes

-

getAsciiStream​(int columnIndex)

-

InputStream

-

Yes

-

getAsciiStream​(String columnLabel)

-

InputStream

-

Yes

-

getBigDecimal(int columnIndex)

-

BigDecimal

-

Yes

-

getBigDecimal(String columnLabel)

-

BigDecimal

-

Yes

-

getBinaryStream​(int columnIndex)

-

InputStream

-

Yes

-

getBinaryStream​(String columnLabel)

-

InputStream

-

Yes

-

getBlob​(int columnIndex)

-

Blob

-

Yes

-

getBlob​(String columnLabel)

-

Blob

-

Yes

-

getBoolean(int columnIndex)

-

Boolean

-

Yes

-

getBoolean(String columnLabel)

-

Boolean

-

Yes

-

getByte(int columnIndex)

-

byte

-

Yes

-

getBytes(int columnIndex)

-

byte[]

-

Yes

-

getByte(String columnLabel)

-

byte

-

Yes

-

getBytes(String columnLabel)

-

byte[]

-

Yes

-

getCharacterStream​(int columnIndex)

-

Reader

-

Yes

-

getCharacterStream​(String columnLabel)

-

Reader

-

Yes

-

getClob​(int columnIndex)

-

Clob

-

Yes

-

getClob​(String columnLabel)

-

Clob

-

Yes

-

getConcurrency()

-

int

-

Yes

-

getCursorName()

-

String

-

Yes

-

getDate(int columnIndex)

-

Date

-

Yes

-

getDate​(int columnIndex, Calendar cal)

-

Date

-

Yes

-

getDate(String columnLabel)

-

Date

-

Yes

-

getDate​(String columnLabel, Calendar cal)

-

Date

-

Yes

-

getDouble(int columnIndex)

-

double

-

Yes

-

getDouble(String columnLabel)

-

double

-

Yes

-

getFetchDirection()

-

int

-

Yes

-

getFetchSize()

-

int

-

Yes

-

getFloat(int columnIndex)

-

float

-

Yes

-

getFloat(String columnLabel)

-

float

-

Yes

-

getInt(int columnIndex)

-

int

-

Yes

-

getInt(String columnLabel)

-

int

-

Yes

-

getLong(int columnIndex)

-

long

-

Yes

-

getLong(String columnLabel)

-

long

-

Yes

-

getMetaData()

-

ResultSetMetaData

-

Yes

-

getObject​(int columnIndex)

-

Object

-

Yes

-

getObject​(int columnIndex, Class<T> type)

-

<T> T

-

Yes

-

getObject​(int columnIndex, Map<String,​Class<?>> map)

-

Object

-

Yes

-

getObject​(String columnLabel)

-

Object

-

Yes

-

getObject​(String columnLabel, Class<T> type)

-

<T> T

-

Yes

-

getObject​(String columnLabel, Map<String,​Class<?>> map)

-

Object

-

Yes

-

getRow()

-

int

-

Yes

-

getShort(int columnIndex)

-

short

-

Yes

-

getShort(String columnLabel)

-

short

-

Yes

-

getSQLXML​(int columnIndex)

-

SQLXML

-

Yes

-

getSQLXML​(String columnLabel)

-

SQLXML

-

Yes

-

getStatement()

-

Statement

-

Yes

-

getString(int columnIndex)

-

String

-

Yes

-

getString(String columnLabel)

-

String

-

Yes

-

getNString(int columnIndex)

-

String

-

Yes

-

getNString(String columnLabel)

-

String

-

Yes

-

getTime(int columnIndex)

-

Time

-

Yes

-

getTime​(int columnIndex, Calendar cal)

-

Time

-

Yes

-

getTime(String columnLabel)

-

Time

-

Yes

-

getTime​(String columnLabel, Calendar cal)

-

Time

-

Yes

-

getTimestamp(int columnIndex)

-

Timestamp

-

Yes

-

getTimestamp​(int columnIndex, Calendar cal)

-

Timestamp

-

Yes

-

getTimestamp(String columnLabel)

-

Timestamp

-

Yes

-

getTimestamp​(String columnLabel, Calendar cal)

-

Timestamp

-

Yes

-

getType()

-

int

-

Yes

-

getWarnings()

-

SQLWarning

-

Yes

-

insertRow()

-

void

-

Yes

-

isAfterLast()

-

Boolean

-

Yes

-

isBeforeFirst()

-

Boolean

-

Yes

-

isClosed()

-

Boolean

-

Yes

-

isFirst()

-

Boolean

-

Yes

-

isLast()

-

Boolean

-

Yes

-

last()

-

Boolean

-

Yes

-

moveToCurrentRow()

-

void

-

Yes

-

moveToInsertRow()

-

void

-

Yes

-

next()

-

Boolean

-

Yes

-

previous()

-

Boolean

-

Yes

-

refreshRow()

-

void

-

Yes

-

relative​(int rows)

-

Boolean

-

Yes

-

rowDeleted()

-

Boolean

-

Yes

-

rowInserted()

-

Boolean

-

Yes

-

rowUpdated()

-

Boolean

-

Yes

-

setFetchDirection​(int direction)

-

void

-

Yes

-

setFetchSize​(int rows)

-

void

-

Yes

-

updateArray​(int columnIndex, Array x)

-

void

-

Yes

-

updateArray​(String columnLabel, Array x)

-

void

-

Yes

-

updateAsciiStream​(int columnIndex, InputStream x, int length)

-

void

-

Yes

-

updateAsciiStream​(String columnLabel, InputStream x, int length)

-

void

-

Yes

-

updateBigDecimal​(int columnIndex, BigDecimal x)

-

void

-

Yes

-

updateBigDecimal​(String columnLabel, BigDecimal x)

-

void

-

Yes

-

updateBinaryStream​(int columnIndex, InputStream x, int length)

-

void

-

Yes

-

updateBinaryStream​(String columnLabel, InputStream x, int length)

-

void

-

Yes

-

updateBoolean​(int columnIndex, boolean x)

-

void

-

Yes

-

updateBoolean​(String columnLabel, boolean x)

-

void

-

Yes

-

updateByte​(int columnIndex, byte x)

-

void

-

Yes

-

updateByte​(String columnLabel, byte x)

-

void

-

Yes

-

updateBytes​(int columnIndex, byte[] x)

-

void

-

Yes

-

updateBytes​(String columnLabel, byte[] x)

-

void

-

Yes

-

updateCharacterStream​(int columnIndex, Reader x, int length)

-

void

-

Yes

-

updateCharacterStream​(String columnLabel, Reader reader, int length)

-

void

-

Yes

-

updateDate​(int columnIndex, Date x)

-

void

-

Yes

-

updateDate​(String columnLabel, Date x)

-

void

-

Yes

-

updateDouble​(int columnIndex, double x)

-

void

-

Yes

-

updateDouble​(String columnLabel, double x)

-

void

-

Yes

-

updateFloat​(int columnIndex, float x)

-

void

-

Yes

-

updateFloat​(String columnLabel, float x)

-

void

-

Yes

-

updateInt​(int columnIndex, int x)

-

void

-

Yes

-

updateInt​(String columnLabel, int x)

-

void

-

Yes

-

updateLong​(int columnIndex, long x)

-

void

-

Yes

-

updateLong​(String columnLabel, long x)

-

void

-

Yes

-

updateNull​(int columnIndex)

-

void

-

Yes

-

updateNull​(String columnLabel)

-

void

-

Yes

-

updateObject​(int columnIndex, Object x)

-

void

-

Yes

-

updateObject​(int columnIndex, Object x, int scaleOrLength)

-

void

-

Yes

-

updateObject​(String columnLabel, Object x)

-

void

-

Yes

-

updateObject​(String columnLabel, Object x, int scaleOrLength)

-

void

-

Yes

-

updateRow()

-

void

-

Yes

-

updateShort​(int columnIndex, short x)

-

void

-

Yes

-

updateShort​(String columnLabel, short x)

-

void

-

Yes

-

updateSQLXML​(int columnIndex, SQLXML xmlObject)

-

void

-

Yes

-

updateSQLXML​(String columnLabel, SQLXML xmlObject)

-

void

-

Yes

-

updateString​(int columnIndex, String x)

-

void

-

Yes

-

updateString​(String columnLabel, String x)

-

void

-

Yes

-

updateTime​(int columnIndex, Time x)

-

void

-

Yes

-

updateTime​(String columnLabel, Time x)

-

void

-

Yes

-

updateTimestamp​(int columnIndex, Timestamp x)

-

void

-

Yes

-

updateTimestamp​(String columnLabel, Timestamp x)

-

void

-

Yes

-

wasNull()

-

Boolean

-

Yes

-
- - ->![](public_sys-resources/icon-note.gif) **说明:** -> ->- 一个Statement不能有多个处于“open”状态的ResultSet。 - ->- 用于遍历结果集(ResultSet)的游标(Cursor)在被提交后不能保持“open”的状态。 - diff --git a/content/docs-lite/zh/docs/Developerguide/java-sql-ResultSetMetaData.md b/content/docs-lite/zh/docs/Developerguide/java-sql-ResultSetMetaData.md deleted file mode 100644 index f9698f1ef52e6e3d3f7bfbbe0c32a7137e82d829..0000000000000000000000000000000000000000 --- a/content/docs-lite/zh/docs/Developerguide/java-sql-ResultSetMetaData.md +++ /dev/null @@ -1,166 +0,0 @@ -# java.sql.ResultSetMetaData - -java.sql.ResultSetMetaData是对ResultSet对象相关信息的具体描述。 - -**表 1** 对java.sql.ResultSetMetaData的支持情况 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

方法名

-

返回值类型

-

支持JDBC 4

-

getCatalogName​(int column)

-

String

-

Yes

-

getColumnClassName​(int column)

-

String

-

Yes

-

getColumnCount()

-

int

-

Yes

-

getColumnDisplaySize​(int column)

-

int

-

Yes

-

getColumnLabel​(int column)

-

String

-

Yes

-

getColumnName(int column)

-

String

-

Yes

-

getColumnType(int column)

-

int

-

Yes

-

getColumnTypeName(int column)

-

String

-

Yes

-

getPrecision​(int column)

-

int

-

Yes

-

getScale​(int column)

-

int

-

Yes

-

getSchemaName​(int column)

-

String

-

Yes

-

getTableName​(int column)

-

String

-

Yes

-

isAutoIncrement​(int column)

-

boolean

-

Yes

-

isCaseSensitive​(int column)

-

boolean

-

Yes

-

isCurrency​(int column)

-

boolean

-

Yes

-

isDefinitelyWritable​(int column)

-

boolean

-

Yes

-

isNullable​(int column)

-

int

-

Yes

-

isReadOnly​(int column)

-

boolean

-

Yes

-

isSearchable​(int column)

-

boolean

-

Yes

-

isSigned​(int column)

-

boolean

-

Yes

-

isWritable​(int column)

-

boolean

-

Yes

-
- - diff --git a/content/docs-lite/zh/docs/Developerguide/java-sql-Statement.md b/content/docs-lite/zh/docs/Developerguide/java-sql-Statement.md deleted file mode 100644 index e6eb95399d341b6584f9701139069a50caa5165f..0000000000000000000000000000000000000000 --- a/content/docs-lite/zh/docs/Developerguide/java-sql-Statement.md +++ /dev/null @@ -1,362 +0,0 @@ -# java.sql.Statement - -java.sql.Statement是SQL语句接口。 - -**表 1** 对java.sql.Statement的支持情况 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

方法名

-

返回值类型

-

支持JDBC 4

-

addBatch​(String sql)

-

void

-

Yes

-

clearBatch()

-

void

-

Yes

-

clearWarnings()

-

void

-

Yes

-

close()

-

void

-

Yes

-

closeOnCompletion()

-

void

-

Yes

-

execute(String sql)

-

Boolean

-

Yes

-

execute​(String sql, int autoGeneratedKeys)

-

Boolean

-

Yes

-

execute​(String sql, int[] columnIndexes)

-

Boolean

-

Yes

-

execute​(String sql, String[] columnNames)

-

Boolean

-

Yes

-

executeBatch()

-

Boolean

-

Yes

-

executeQuery(String sql)

-

ResultSet

-

Yes

-

executeUpdate(String sql)

-

int

-

Yes

-

executeUpdate​(String sql, int autoGeneratedKeys)

-

int

-

Yes

-

executeUpdate​(String sql, int[] columnIndexes)

-

int

-

Yes

-

executeUpdate​(String sql, String[] columnNames)

-

int

-

Yes

-

getConnection()

-

Connection

-

Yes

-

getFetchDirection()

-

int

-

Yes

-

getFetchSize()

-

int

-

Yes

-

getGeneratedKeys()

-

ResultSet

-

Yes

-

getMaxFieldSize()

-

int

-

Yes

-

getMaxRows()

-

int

-

Yes

-

getMoreResults()

-

boolean

-

Yes

-

getMoreResults​(int current)

-

boolean

-

Yes

-

getResultSet()

-

ResultSet

-

Yes

-

getResultSetConcurrency()

-

int

-

Yes

-

getResultSetHoldability()

-

int

-

Yes

-

getResultSetType()

-

int

-

Yes

-

getQueryTimeout()

-

int

-

Yes

-

getUpdateCount()

-

int

-

Yes

-

getWarnings()

-

SQLWarning

-

Yes

-

isClosed()

-

Boolean

-

Yes

-

isCloseOnCompletion()

-

Boolean

-

Yes

-

isPoolable()

-

Boolean

-

Yes

-

setCursorName​(String name)

-

void

-

Yes

-

setEscapeProcessing​(boolean enable)

-

void

-

Yes

-

setFetchDirection​(int direction)

-

void

-

Yes

-

setMaxFieldSize​(int max)

-

void

-

Yes

-

setMaxRows​(int max)

-

void

-

Yes

-

setPoolable​(boolean poolable)

-

void

-

Yes

-

setQueryTimeout(int seconds)

-

void

-

Yes

-

setFetchSize(int rows)

-

void

-

Yes

-

cancel()

-

void

-

Yes

-

executeLargeUpdate(String sql)

-

long

-

No

-

getLargeUpdateCount()

-

long

-

No

-

executeLargeBatch()

-

long

-

No

-

executeLargeUpdate(String sql, int autoGeneratedKeys)

-

long

-

No

-

executeLargeUpdate(String sql, int[] columnIndexes)

-

long

-

No

-

executeLargeUpdate(String sql, String[] columnNames)

-

long

-

No

-
- ->![](public_sys-resources/icon-note.gif) **说明:** -> ->- 通过setFetchSize可以减少结果集在客户端的内存占用情况。它的原理是通过将结果集打包成游标,然后分段处理,所以会加大数据库与客户端的通信量,会有性能损耗。 -> ->- 由于数据库游标是事务内有效,所以,在设置setFetchSize的同时,需要将连接设置为非自动提交模式,setAutoCommit\(false\)。同时在业务数据需要持久化到数据库中时,在连接上执行提交操作。 -> ->- LargeUpdate相关方法必须在JDBC4.2及以上使用。 - diff --git a/content/docs-lite/zh/docs/Developerguide/javax-naming-Context.md b/content/docs-lite/zh/docs/Developerguide/javax-naming-Context.md deleted file mode 100644 index 9ea5476120f15418b60672688062ed4c4b861e4a..0000000000000000000000000000000000000000 --- a/content/docs-lite/zh/docs/Developerguide/javax-naming-Context.md +++ /dev/null @@ -1,88 +0,0 @@ -# javax.naming.Context - -javax.naming.Context是连接配置的上下文接口。 - -**表 1** 对javax.naming.Context的支持情况 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

方法名

-

返回值类型

-

支持JDBC 4

-

bind(Name name, Object obj)

-

void

-

Yes

-

bind(String name, Object obj)

-

void

-

Yes

-

lookup(Name name)

-

Object

-

Yes

-

lookup(String name)

-

Object

-

Yes

-

rebind(Name name, Object obj)

-

void

-

Yes

-

rebind(String name, Object obj)

-

void

-

Yes

-

rename(Name oldName, Name newName)

-

void

-

Yes

-

rename(String oldName, String newName)

-

void

-

Yes

-

unbind(Name name)

-

void

-

Yes

-

unbind(String name)

-

void

-

Yes

-
- diff --git a/content/docs-lite/zh/docs/Developerguide/javax-naming-spi-InitialContextFactory.md b/content/docs-lite/zh/docs/Developerguide/javax-naming-spi-InitialContextFactory.md deleted file mode 100644 index 52482b871d5e014a4ad2188edcf86464c8ab09da..0000000000000000000000000000000000000000 --- a/content/docs-lite/zh/docs/Developerguide/javax-naming-spi-InitialContextFactory.md +++ /dev/null @@ -1,25 +0,0 @@ -# javax.naming.spi.InitialContextFactory - -javax.naming.spi.InitialContextFactory是初始连接上下文工厂接口。 - -**表 1** 对javax.naming.spi.InitialContextFactory的支持情况 - - - - - - - - - - - - -

方法名

-

返回值类型

-

支持JDBC 4

-

getInitialContext(Hashtable<?,?> environment)

-

Context

-

Yes

-
- diff --git a/content/docs-lite/zh/docs/Developerguide/javax-sql-ConnectionPoolDataSource.md b/content/docs-lite/zh/docs/Developerguide/javax-sql-ConnectionPoolDataSource.md deleted file mode 100644 index e4e47416c19b540b566f1a163afd2bf6956fc065..0000000000000000000000000000000000000000 --- a/content/docs-lite/zh/docs/Developerguide/javax-sql-ConnectionPoolDataSource.md +++ /dev/null @@ -1,33 +0,0 @@ -# javax.sql.ConnectionPoolDataSource - -javax.sql.ConnectionPoolDataSource是数据源连接池接口。 - -**表 1** 对javax.sql.ConnectionPoolDataSource的支持情况 - - - - - - - - - - - - - - - - - -

方法名

-

返回值类型

-

支持JDBC 4

-

getPooledConnection()

-

PooledConnection

-

Yes

-

getPooledConnection(String user,String password)

-

PooledConnection

-

Yes

-
- diff --git a/content/docs-lite/zh/docs/Developerguide/javax-sql-DataSource.md b/content/docs-lite/zh/docs/Developerguide/javax-sql-DataSource.md deleted file mode 100644 index b5d224d0157edbbbe42cc7f5ca86f64213b18be4..0000000000000000000000000000000000000000 --- a/content/docs-lite/zh/docs/Developerguide/javax-sql-DataSource.md +++ /dev/null @@ -1,60 +0,0 @@ -# javax.sql.DataSource - -javax.sql.DataSource是数据源接口。 - -**表 1** 对javax.sql.DataSource接口的支持情况 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

方法名

-

返回值类型

-

支持JDBC 4

-

getConneciton()

-

Connection

-

Yes

-

getConnection(String username,String password)

-

Connection

-

Yes

-

getLoginTimeout()

-

int

-

Yes

-

getLogWriter()

-

PrintWriter

-

Yes

-

setLoginTimeout(int seconds)

-

void

-

Yes

-

setLogWriter(PrintWriter out)

-

void

-

Yes

-
- diff --git a/content/docs-lite/zh/docs/Developerguide/javax-sql-PooledConnection.md b/content/docs-lite/zh/docs/Developerguide/javax-sql-PooledConnection.md deleted file mode 100644 index 786c2a77378c790b92e64efe220c2178bbe58176..0000000000000000000000000000000000000000 --- a/content/docs-lite/zh/docs/Developerguide/javax-sql-PooledConnection.md +++ /dev/null @@ -1,46 +0,0 @@ -# javax.sql.PooledConnection - -javax.sql.PooledConnection是由连接池创建的连接接口。 - -**表 1** 对javax.sql.PooledConnection的支持情况 - - - - - - - - - - - - - - - - - - - - - - - - -

方法名

-

返回值类型

-

支持JDBC 4

-

addConnectionEventListener (ConnectionEventListener listener)

-

void

-

Yes

-

close()

-

void

-

Yes

-

getConnection()

-

Connection

-

Yes

-

removeConnectionEventListener (ConnectionEventListener listener)

-

void

-

Yes

-
- diff --git "a/content/docs-lite/zh/docs/Developerguide/libpq\344\275\277\347\224\250\344\276\235\350\265\226\347\232\204\345\244\264\346\226\207\344\273\266.md" "b/content/docs-lite/zh/docs/Developerguide/libpq\344\275\277\347\224\250\344\276\235\350\265\226\347\232\204\345\244\264\346\226\207\344\273\266.md" deleted file mode 100644 index 8d2d630de52c7971d503053933051334044b826b..0000000000000000000000000000000000000000 --- "a/content/docs-lite/zh/docs/Developerguide/libpq\344\275\277\347\224\250\344\276\235\350\265\226\347\232\204\345\244\264\346\226\207\344\273\266.md" +++ /dev/null @@ -1,4 +0,0 @@ -# libpq使用依赖的头文件 - -使用libpq的前端程序必须包括头文件libpq-fe.h并且必须与libpq库链接。 - diff --git "a/content/docs-lite/zh/docs/Developerguide/libpq\346\216\245\345\217\243\345\217\202\350\200\203.md" "b/content/docs-lite/zh/docs/Developerguide/libpq\346\216\245\345\217\243\345\217\202\350\200\203.md" deleted file mode 100644 index 073d0052e9ff92879f16294b7b43c48f0bc02671..0000000000000000000000000000000000000000 --- "a/content/docs-lite/zh/docs/Developerguide/libpq\346\216\245\345\217\243\345\217\202\350\200\203.md" +++ /dev/null @@ -1,14 +0,0 @@ -# libpq接口参考 - -- **[数据库连接控制函数](数据库连接控制函数.md)** - -- **[数据库执行语句函数](数据库执行语句函数.md)** - -- **[异步命令处理](异步命令处理.md)** - -- **[取消正在处理的查询](取消正在处理的查询.md)** - -- **[示例](示例-libpq.md)** - -- **[链接参数](链接参数.md)** - diff --git a/content/docs-lite/zh/docs/Developerguide/psycopg2-connect.md b/content/docs-lite/zh/docs/Developerguide/psycopg2-connect.md deleted file mode 100644 index a2ab42faf941d68c1c35129c8fac6c468f5f20df..0000000000000000000000000000000000000000 --- a/content/docs-lite/zh/docs/Developerguide/psycopg2-connect.md +++ /dev/null @@ -1,79 +0,0 @@ -# psycopg2.connect\(\) - -## 功能描述 - -此方法创建新的数据库会话并返回新的connection对象。 - -## 原型 - -``` -conn=psycopg2.connect(dbname="test",user="postgres",password="secret",host="127.0.0.1",port="5432") -``` - -## 参数 - -**表 1** psycopg2.connect参数 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

关键字

-

参数说明

-

dbname

-

数据库名称。

-

user

-

用户名。

-

password

-

密码。

-

host

-

数据库IP地址,默认为UNIX socket类型。

-

port

-

连接端口号,默认为5432。

-

sslmode

-

ssl模式,ssl连接时用。

-

sslcert

-

客户端证书路径,ssl连接时用。

-

sslkey

-

客户端密钥路径,ssl连接时用。

-

sslrootcert

-

根证书路径,ssl连接时用。

-
- -## 返回值 - -connection对象(连接openGauss数据库实例的对象)。 - -## 示例 - -请参见[示例:常用操作](示例-常用操作_Psycopg.md)。 - diff --git a/content/docs-lite/zh/docs/Developerguide/public_sys-resources/icon-caution.gif b/content/docs-lite/zh/docs/Developerguide/public_sys-resources/icon-caution.gif deleted file mode 100644 index 6e90d7cfc2193e39e10bb58c38d01a23f045d571..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/public_sys-resources/icon-caution.gif and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/public_sys-resources/icon-danger.gif b/content/docs-lite/zh/docs/Developerguide/public_sys-resources/icon-danger.gif deleted file mode 100644 index 6e90d7cfc2193e39e10bb58c38d01a23f045d571..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/public_sys-resources/icon-danger.gif and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/public_sys-resources/icon-note.gif b/content/docs-lite/zh/docs/Developerguide/public_sys-resources/icon-note.gif deleted file mode 100644 index 6314297e45c1de184204098efd4814d6dc8b1cda..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/public_sys-resources/icon-note.gif and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/public_sys-resources/icon-notice.gif b/content/docs-lite/zh/docs/Developerguide/public_sys-resources/icon-notice.gif deleted file mode 100644 index 86024f61b691400bea99e5b1f506d9d9aef36e27..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/public_sys-resources/icon-notice.gif and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/public_sys-resources/icon-tip.gif b/content/docs-lite/zh/docs/Developerguide/public_sys-resources/icon-tip.gif deleted file mode 100644 index 93aa72053b510e456b149f36a0972703ea9999b7..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/public_sys-resources/icon-tip.gif and /dev/null differ diff --git a/content/docs-lite/zh/docs/Developerguide/public_sys-resources/icon-warning.gif b/content/docs-lite/zh/docs/Developerguide/public_sys-resources/icon-warning.gif deleted file mode 100644 index 6e90d7cfc2193e39e10bb58c38d01a23f045d571..0000000000000000000000000000000000000000 Binary files a/content/docs-lite/zh/docs/Developerguide/public_sys-resources/icon-warning.gif and /dev/null differ diff --git "a/content/docs-lite/zh/docs/Developerguide/\345\205\263\351\227\255\350\277\236\346\216\245_JDBC.md" "b/content/docs-lite/zh/docs/Developerguide/\345\205\263\351\227\255\350\277\236\346\216\245_JDBC.md" deleted file mode 100644 index 1a568afedbf01a64af8f003f30c8e2dfe6746d76..0000000000000000000000000000000000000000 --- "a/content/docs-lite/zh/docs/Developerguide/\345\205\263\351\227\255\350\277\236\346\216\245_JDBC.md" +++ /dev/null @@ -1,6 +0,0 @@ -# 关闭连接 - -在使用数据库连接完成相应的数据操作后,需要关闭数据库连接。 - -关闭数据库连接可以直接调用其close方法即可。如:**Connection conn = DriverManager.getConnection\("url","user","password"\) ; conn.close\(\)**; - diff --git "a/content/docs-lite/zh/docs/Developerguide/\345\205\263\351\227\255\350\277\236\346\216\245_Psycopg.md" "b/content/docs-lite/zh/docs/Developerguide/\345\205\263\351\227\255\350\277\236\346\216\245_Psycopg.md" deleted file mode 100644 index 188cfa9f92ce920ceb155fc635ddc98a4888cfb8..0000000000000000000000000000000000000000 --- "a/content/docs-lite/zh/docs/Developerguide/\345\205\263\351\227\255\350\277\236\346\216\245_Psycopg.md" +++ /dev/null @@ -1,8 +0,0 @@ -# 关闭连接 - -在使用数据库连接完成相应的数据操作后,需要关闭数据库连接。关闭数据库连接可以直接调用其close方法,如connection.close\(\)。 - ->![](public_sys-resources/icon-caution.gif) **注意:** -> ->此方法关闭数据库连接,并不自动调用commit\(\)。如果只是关闭数据库连接而不调用commit\(\)方法,那么所有更改将会丢失。 - diff --git "a/content/docs-lite/zh/docs/Developerguide/\345\212\240\350\275\275\351\251\261\345\212\250_JDBC.md" "b/content/docs-lite/zh/docs/Developerguide/\345\212\240\350\275\275\351\251\261\345\212\250_JDBC.md" deleted file mode 100644 index 077a7ea1055b3454a512bfc91744c66a2053b01a..0000000000000000000000000000000000000000 --- "a/content/docs-lite/zh/docs/Developerguide/\345\212\240\350\275\275\351\251\261\345\212\250_JDBC.md" +++ /dev/null @@ -1,13 +0,0 @@ -# 加载驱动 - -在创建数据库连接之前,需要先加载数据库驱动程序。 - -加载驱动有两种方法: - -- 在JVM启动时参数传递:java -Djdbc.drivers=org.postgresql.Driver jdbctest - - >![](public_sys-resources/icon-note.gif) **说明:** - > - >上述jdbctest为测试用例程序的名称。 - - diff --git "a/content/docs-lite/zh/docs/Developerguide/\345\212\240\350\275\275\351\251\261\345\212\250_Psycopg.md" "b/content/docs-lite/zh/docs/Developerguide/\345\212\240\350\275\275\351\251\261\345\212\250_Psycopg.md" deleted file mode 100644 index 1b9b9b345a9ceb1360e683df49ae2c792895cecf..0000000000000000000000000000000000000000 --- "a/content/docs-lite/zh/docs/Developerguide/\345\212\240\350\275\275\351\251\261\345\212\250_Psycopg.md" +++ /dev/null @@ -1,15 +0,0 @@ -# 加载驱动 - -- 在使用驱动之前,需要做如下操作: - 1. 先解压版本对应驱动包,使用root用户将psycopg2拷贝到python安装目录下的site-packages文件夹下。 - 2. 修改psycopg2目录权限为755。 - 3. 将psycopg2目录添加到环境变量$PYTHONPATH,并使之生效。 - 4. 对于非数据库用户,需要将解压后的lib目录,配置在LD\_LIBRARY\_PATH中。 - -- 在创建数据库连接之前,需要先加载如下数据库驱动程序: - - ``` - import psycopg2 - ``` - - diff --git "a/content/docs-lite/zh/docs/Developerguide/\345\217\226\346\266\210\346\255\243\345\234\250\345\244\204\347\220\206\347\232\204\346\237\245\350\257\242.md" "b/content/docs-lite/zh/docs/Developerguide/\345\217\226\346\266\210\346\255\243\345\234\250\345\244\204\347\220\206\347\232\204\346\237\245\350\257\242.md" deleted file mode 100644 index d2fe370814f0f18b7a628d81ba7fb035ad36a4ea..0000000000000000000000000000000000000000 --- "a/content/docs-lite/zh/docs/Developerguide/\345\217\226\346\266\210\346\255\243\345\234\250\345\244\204\347\220\206\347\232\204\346\237\245\350\257\242.md" +++ /dev/null @@ -1,11 +0,0 @@ -# 取消正在处理的查询 - -客户端应用可以使用本节描述的函数,要求取消一个仍在被服务器处理的命令。 - -- **[PQgetCancel](PQgetCancel.md)** - -- **[PQfreeCancel](PQfreeCancel.md)** - -- **[PQcancel](PQcancel.md)** - - diff --git "a/content/docs-lite/zh/docs/Developerguide/\345\237\272\344\272\216JDBC\345\274\200\345\217\221.md" "b/content/docs-lite/zh/docs/Developerguide/\345\237\272\344\272\216JDBC\345\274\200\345\217\221.md" deleted file mode 100644 index d53b0963635dba51bf1fdd5e6dbd19b7a35f7d57..0000000000000000000000000000000000000000 --- "a/content/docs-lite/zh/docs/Developerguide/\345\237\272\344\272\216JDBC\345\274\200\345\217\221.md" +++ /dev/null @@ -1,24 +0,0 @@ -# 基于JDBC开发 - -JDBC(Java Database Connectivity,Java数据库连接)是一种用于执行SQL语句的Java API,可以为多种关系数据库提供统一访问接口,应用程序可基于它操作数据。openGauss库提供了对JDBC 4.0特性的支持,需要使用JDK1.8版本编译程序代码,不支持JDBC桥接ODBC方式。 - -- **[JDBC包、驱动类和环境类](JDBC包-驱动类和环境类.md)** -- **[开发流程](开发流程_JDBC.md)** -- **[加载驱动](加载驱动_JDBC.md)** -- **[连接数据库](连接数据库_JDBC.md)** -- **[连接数据库(以SSL方式)](连接数据库_以SSL方式.md)** -- **[连接数据库(以UDS方式)](连接数据库_UDS方式.md)** -- **[执行SQL语句](执行SQL语句_JDBC.md)** -- **[处理结果集](处理结果集_JDBC.md)** -- **[关闭连接](关闭连接_JDBC.md)** -- **[日志管理](日志管理.md)** -- **[示例:常用操作](示例-常用操作_JDBC.md)** -- **[示例:重新执行应用SQL](示例-重新执行应用SQL.md)** -- **[示例:通过本地文件导入导出数据](示例-通过本地文件导入导出数据.md)** -- **[示例:从MY迁移数据](示例-从MY迁移数据.md)** -- **[示例:逻辑复制代码示例](示例-逻辑复制代码示例.md)** -- **[示例:不同场景下连接数据库参数配置](示例-不同场景下连接数据库参数配置.md)** -- **[JDBC接口参考](JDBC接口参考.md)** -- **[JDBC常用参数参考](JDBC常用参数参考.md)** - - diff --git "a/content/docs-lite/zh/docs/Developerguide/\345\237\272\344\272\216Psycopg\345\274\200\345\217\221.md" "b/content/docs-lite/zh/docs/Developerguide/\345\237\272\344\272\216Psycopg\345\274\200\345\217\221.md" deleted file mode 100644 index c20ec4481170bb3ef39417b8c44872ad86a5fcd3..0000000000000000000000000000000000000000 --- "a/content/docs-lite/zh/docs/Developerguide/\345\237\272\344\272\216Psycopg\345\274\200\345\217\221.md" +++ /dev/null @@ -1,49 +0,0 @@ -# 基于Psycopg开发 - -Psycopg是一种用于执行SQL语句的PythonAPI,可以为PostgreSQL、openGauss数据库提供统一访问接口,应用程序可基于它进行数据操作。Psycopg2是对libpq的封装,主要使用C语言实现,既高效又安全。它具有客户端游标和服务器端游标、异步通信和通知、支持“COPY TO/COPY FROM”功能。支持多种类型Python开箱即用,适配PostgreSQL数据类型;通过灵活的对象适配系统,可以扩展和定制适配。Psycopg2兼容Unicode和Python 3。 - -openGauss数据库提供了对Psycopg2特性的支持,并且支持psycopg2通过SSL模式链接。 - -**表 1** Psycopg支持平台 - - - - - - - - - - - - - -

操作系统

-

平台

-

EulerOS 2.5

-

x86_64位

-

EulerOS 2.8

-

ARM64位

-
- -- **[Psycopg包](Psycopg包.md)** - -- **[开发流程](开发流程_Psycopg.md)** - -- **[加载驱动](加载驱动_Psycopg.md)** - -- **[连接数据库](连接数据库_Psycopg.md)** - -- **[执行SQL语句](执行SQL语句_Psycopg.md)** - -- **[处理结果集](处理结果集_Psycopg.md)** - -- **[关闭连接](关闭连接_Psycopg.md)** - -- **[连接数据库(SSL方式)](连接数据库_SSL方式_Psycopg.md)** - -- **[示例:常用操作](示例-常用操作_Psycopg.md)** - -- **[Psycopg接口参考](Psycopg接口参考.md)** - - diff --git "a/content/docs-lite/zh/docs/Developerguide/\345\237\272\344\272\216libpq\345\274\200\345\217\221.md" "b/content/docs-lite/zh/docs/Developerguide/\345\237\272\344\272\216libpq\345\274\200\345\217\221.md" deleted file mode 100644 index 90dc2709f710c35be27006c69d642549cec5f5fa..0000000000000000000000000000000000000000 --- "a/content/docs-lite/zh/docs/Developerguide/\345\237\272\344\272\216libpq\345\274\200\345\217\221.md" +++ /dev/null @@ -1,15 +0,0 @@ -# 基于libpq开发 - -libpq是openGaussC应用程序接口。libpq是一套允许客户程序向openGauss服务器服务进程发送查询并且获得查询返回的库函数。同时也是其他几个openGauss应用接口下面的引擎。本章给出了两个示例显示如何利用libpq编写代码。 - -- **[libpq使用依赖的头文件](libpq使用依赖的头文件.md)** - -- **[开发流程](开发流程_libpq.md)** - -- **[示例](示例-libpq.md)** - -- **[libpq接口参考](libpq接口参考.md)** - -- **[链接参数](链接参数.md)** - - diff --git "a/content/docs-lite/zh/docs/Developerguide/\345\244\204\347\220\206\347\273\223\346\236\234\351\233\206_JDBC.md" "b/content/docs-lite/zh/docs/Developerguide/\345\244\204\347\220\206\347\273\223\346\236\234\351\233\206_JDBC.md" deleted file mode 100644 index 0e8425bfce4bd9c6338d3a9e094cc9e337117be8..0000000000000000000000000000000000000000 --- "a/content/docs-lite/zh/docs/Developerguide/\345\244\204\347\220\206\347\273\223\346\236\234\351\233\206_JDBC.md" +++ /dev/null @@ -1,186 +0,0 @@ -# 处理结果集 - -## 设置结果集类型 - -不同类型的结果集有各自的应用场景,应用程序需要根据实际情况选择相应的结果集类型。在执行SQL语句过程中,都需要先创建相应的语句对象,而部分创建语句对象的方法提供了设置结果集类型的功能。具体的参数设置如[表1](#zh-cn_topic_0283136621_zh-cn_topic_0237120384_zh-cn_topic_0213179150_zh-cn_topic_0189250321_zh-cn_topic_0059778370_t600ecae93052471d819154e0f14d8fc3)所示。涉及的Connection的方法如下: - -``` -//创建一个Statement对象,该对象将生成具有给定类型和并发性的ResultSet对象。 -createStatement(int resultSetType, int resultSetConcurrency); - -//创建一个PreparedStatement对象,该对象将生成具有给定类型和并发性的ResultSet对象。 -prepareStatement(String sql, int resultSetType, int resultSetConcurrency); - -//创建一个CallableStatement对象,该对象将生成具有给定类型和并发性的ResultSet对象。 -prepareCall(String sql, int resultSetType, int resultSetConcurrency); -``` - -**表 1** 结果集类型 - - - - - - - - - - - - - -

参数

-

描述

-

resultSetType

-

表示结果集的类型,具体有三种类型:

-
  • ResultSet.TYPE_FORWARD_ONLY:ResultSet只能向前移动。是缺省值。
  • ResultSet.TYPE_SCROLL_SENSITIVE:在修改后重新滚动到修改所在行,可以看到修改后的结果。
  • ResultSet.TYPE_SCROLL_INSENSITIVE:对可修改例程所做的编辑不进行显示。
-
说明:

结果集从数据库中读取了数据之后,即使类型是ResultSet.TYPE_SCROLL_SENSITIVE,也不会看到由其他事务在这之后引起的改变。调用ResultSet的refreshRow()方法,可进入数据库并从其中取得当前游标所指记录的最新数据。

-
-

resultSetConcurrency

-

表示结果集的并发,具体有两种类型:

-
  • ResultSet.CONCUR_READ_ONLY:如果不从结果集中的数据建立一个新的更新语句,不能对结果集中的数据进行更新。
  • ResultSet.CONCUR_UPDATEABLE:可改变的结果集。对于可滚动的结果集,可对结果集进行适当的改变。
-
- -## 在结果集中定位 - -ResultSet对象具有指向其当前数据行的光标。最初,光标被置于第一行之前。next方法将光标移动到下一行;因为该方法在ResultSet对象没有下一行时返回false,所以可以在while循环中使用它来迭代结果集。但对于可滚动的结果集,JDBC驱动程序提供更多的定位方法,使ResultSet指向特定的行。定位方法如[表2](#zh-cn_topic_0283136621_zh-cn_topic_0237120384_zh-cn_topic_0213179150_zh-cn_topic_0189250321_zh-cn_topic_0059778370_t0e427b4d1b1f4d67899fac4ad3df1049)所示。 - -**表 2** 在结果集中定位的方法 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

方法

-

描述

-

next()

-

把ResultSet向下移动一行。

-

previous()

-

把ResultSet向上移动一行。

-

beforeFirst()

-

把ResultSet定位到第一行之前。

-

afterLast()

-

把ResultSet定位到最后一行之后。

-

first()

-

把ResultSet定位到第一行。

-

last()

-

把ResultSet定位到最后一行。

-

absolute(int)

-

把ResultSet移动到参数指定的行数。

-

relative(int)

-

通过设置为1向前(设置为1,相当于next())或者向后(设置为-1,相当于previous())移动参数指定的行。

-
- -## 获取结果集中光标的位置 - -对于可滚动的结果集,可能会调用定位方法来改变光标的位置。JDBC驱动程序提供了获取结果集中光标所处位置的方法。获取光标位置的方法如[表3](#zh-cn_topic_0283136621_zh-cn_topic_0237120384_zh-cn_topic_0213179150_zh-cn_topic_0189250321_zh-cn_topic_0059778370_tfc10dffc5995480281e8065b4b03d370)所示。 - -**表 3** 获取结果集光标的位置 - - - - - - - - - - - - - - - - - - - - - - -

方法

-

描述

-

isFirst()

-

是否在一行。

-

isLast()

-

是否在最后一行。

-

isBeforeFirst()

-

是否在第一行之前。

-

isAfterLast()

-

是否在最后一行之后。

-

getRow()

-

获取当前在第几行。

-
- -## 获取结果集中的数据 - -ResultSet对象提供了丰富的方法,以获取结果集中的数据。获取数据常用的方法如[表4](#zh-cn_topic_0283136621_zh-cn_topic_0237120384_zh-cn_topic_0213179150_zh-cn_topic_0189250321_zh-cn_topic_0059778370_t92d6c213fa8b403796ae7da7e7cd6c46)所示,其他方法请参考JDK官方文档。 - -**表 4** ResultSet对象的常用方法 - - - - - - - - - - - - - - - - - - - - - - - - - -

方法

-

描述

-

int getInt(int columnIndex)

-

按列标获取int型数据。

-

int getInt(String columnLabel)

-

按列名获取int型数据。

-

String getString(int columnIndex)

-

按列标获取String型数据。

-

String getString(String columnLabel)

-

按列名获取String型数据。

-

Date getDate(int columnIndex)

-

按列标获取Date型数据

-

Date getDate(String columnLabel)

-

按列名获取Date型数据。

-
- diff --git "a/content/docs-lite/zh/docs/Developerguide/\345\244\204\347\220\206\347\273\223\346\236\234\351\233\206_Psycopg.md" "b/content/docs-lite/zh/docs/Developerguide/\345\244\204\347\220\206\347\273\223\346\236\234\351\233\206_Psycopg.md" deleted file mode 100644 index 0918f32f1a3162ca7930c2b9f0542b8226135714..0000000000000000000000000000000000000000 --- "a/content/docs-lite/zh/docs/Developerguide/\345\244\204\347\220\206\347\273\223\346\236\234\351\233\206_Psycopg.md" +++ /dev/null @@ -1,5 +0,0 @@ -# 处理结果集 - -1. cursor.fetchone\(\):这种方法提取的查询结果集的下一行,返回一个序列,没有数据可用时则返回空。 -2. cursor.fetchall\(\):这个例程获取所有查询结果\(剩余\)行,返回一个列表。空行时则返回空列表。 - diff --git "a/content/docs-lite/zh/docs/Developerguide/\345\255\227\346\256\265\350\256\276\350\256\241.md" "b/content/docs-lite/zh/docs/Developerguide/\345\255\227\346\256\265\350\256\276\350\256\241.md" deleted file mode 100644 index a683771cb546b12f9a1078a4b23672d3b4bcf2e0..0000000000000000000000000000000000000000 --- "a/content/docs-lite/zh/docs/Developerguide/\345\255\227\346\256\265\350\256\276\350\256\241.md" +++ /dev/null @@ -1,97 +0,0 @@ -# 字段设计 - -## 选择数据类型 - -在字段设计时,基于查询效率的考虑,一般遵循以下原则: - -- 【建议】尽量使用高效数据类型。 - - 选择数值类型时,在满足业务精度的情况下,选择数据类型的优先级从高到低依次为整数、浮点数、NUMERIC。 - -- 【建议】当多个表存在逻辑关系时,表示同一含义的字段应该使用相同的数据类型。 -- 【建议】对于字符串数据,建议使用变长字符串数据类型,并指定最大长度。请务必确保指定的最大长度大于需要存储的最大字符数,避免超出最大长度时出现字符截断现象。除非明确知道数据类型为固定长度字符串,否则,不建议使用CHAR\(n\)、BPCHAR\(n\)、NCHAR\(n\)、CHARACTER\(n\)。 - - 关于字符串类型的详细说明,请参见[常用字符串类型介绍](#section290310115932)。 - - -## 常用字符串类型介绍 - -在进行字段设计时,需要根据数据特征选择相应的数据类型。字符串类型在使用时比较容易混淆,下表列出了openGauss中常见的字符串类型: - -**表 1** 常用字符串类型 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

名称

-

描述

-

最大存储空间

-

CHAR(n)

-

定长字符串,n描述了存储的字节长度,如果输入的字符串字节格式小于n,那么后面会自动用空字符补齐至n个字节。

-

10MB

-

CHARACTER(n)

-

定长字符串,n描述了存储的字节长度,如果输入的字符串字节格式小于n,那么后面会自动用空字符补齐至n个字节。

-

10MB

-

NCHAR(n)

-

定长字符串,n描述了存储的字节长度,如果输入的字符串字节格式小于n,那么后面会自动用空字符补齐至n个字节。

-

10MB

-

BPCHAR(n)

-

定长字符串,n描述了存储的字节长度,如果输入的字符串字节格式小于n,那么后面会自动用空字符补齐至n个字节。

-

10MB

-

VARCHAR(n)

-

变长字符串,n描述了可以存储的最大字节长度。

-

10MB

-

CHARACTER VARYING(n)

-

变长字符串,n描述了可以存储的最大字节长度;此数据类型和VARCHAR(n)是同一数据类型的不同表达形式。

-

10MB

-

VARCHAR2(n)

-

变长字符串,n描述了可以存储的最大字节长度,此数据类型是为兼容Oracle类型新增的,行为和VARCHAR(n)一致。

-

10MB

-

NVARCHAR2(n)

-

变长字符串,n描述了可以存储的最大字节长度。

-

10MB

-

TEXT

-

不限长度(不超过1GB-8203字节)变长字符串。

-

1GB-8203字节

-
- diff --git "a/content/docs-lite/zh/docs/Developerguide/\345\267\245\345\205\267\345\257\271\346\216\245.md" "b/content/docs-lite/zh/docs/Developerguide/\345\267\245\345\205\267\345\257\271\346\216\245.md" deleted file mode 100644 index 85a4fdb1f4c205eb22e9590f720f7f002f5fafae..0000000000000000000000000000000000000000 --- "a/content/docs-lite/zh/docs/Developerguide/\345\267\245\345\205\267\345\257\271\346\216\245.md" +++ /dev/null @@ -1,5 +0,0 @@ -# 工具对接 - -- **[JDBC配置](JDBC配置.md)** - - diff --git "a/content/docs-lite/zh/docs/Developerguide/\345\272\224\347\224\250\345\274\200\345\217\221\346\214\207\345\215\227.md" "b/content/docs-lite/zh/docs/Developerguide/\345\272\224\347\224\250\345\274\200\345\217\221\346\214\207\345\215\227.md" deleted file mode 100644 index aafa7f2207bd8b15cb1d07400bde82e52b9f9a9e..0000000000000000000000000000000000000000 --- "a/content/docs-lite/zh/docs/Developerguide/\345\272\224\347\224\250\345\274\200\345\217\221\346\214\207\345\215\227.md" +++ /dev/null @@ -1 +0,0 @@ -# 应用开发指南 \ No newline at end of file diff --git "a/content/docs-lite/zh/docs/Developerguide/\345\272\224\347\224\250\347\250\213\345\272\217\345\274\200\345\217\221\346\225\231\347\250\213.md" "b/content/docs-lite/zh/docs/Developerguide/\345\272\224\347\224\250\347\250\213\345\272\217\345\274\200\345\217\221\346\225\231\347\250\213.md" deleted file mode 100644 index 6b3594c9a4dd7f351ff884cb49096eaf05abb56e..0000000000000000000000000000000000000000 --- "a/content/docs-lite/zh/docs/Developerguide/\345\272\224\347\224\250\347\250\213\345\272\217\345\274\200\345\217\221\346\225\231\347\250\213.md" +++ /dev/null @@ -1,13 +0,0 @@ -# 应用程序开发教程 - -- **[开发规范](开发规范.md)** - -- **[基于JDBC开发](基于JDBC开发.md)** - -- **[基于libpq开发](基于libpq开发.md)** - -- **[基于Psycopg开发](基于Psycopg开发.md)** - -- **[调试](调试.md)** - - diff --git "a/content/docs-lite/zh/docs/Developerguide/\345\274\200\345\217\221\346\265\201\347\250\213_JDBC.md" "b/content/docs-lite/zh/docs/Developerguide/\345\274\200\345\217\221\346\265\201\347\250\213_JDBC.md" deleted file mode 100644 index 0fb0dccdb66dcc8f6e7643956cdcb1ab91de6609..0000000000000000000000000000000000000000 --- "a/content/docs-lite/zh/docs/Developerguide/\345\274\200\345\217\221\346\265\201\347\250\213_JDBC.md" +++ /dev/null @@ -1,5 +0,0 @@ -# 开发流程 - -**图 1** 采用JDBC开发应用程序的流程 -![](figures/采用JDBC开发应用程序的流程.png "采用JDBC开发应用程序的流程") - diff --git "a/content/docs-lite/zh/docs/Developerguide/\345\274\200\345\217\221\346\265\201\347\250\213_Psycopg.md" "b/content/docs-lite/zh/docs/Developerguide/\345\274\200\345\217\221\346\265\201\347\250\213_Psycopg.md" deleted file mode 100644 index 015471e1db870b87c9e479306a62db68d085f397..0000000000000000000000000000000000000000 --- "a/content/docs-lite/zh/docs/Developerguide/\345\274\200\345\217\221\346\265\201\347\250\213_Psycopg.md" +++ /dev/null @@ -1,5 +0,0 @@ -# 开发流程 - -**图 1** 采用Psycopg2开发应用程序的流程 -![](figures/采用Psycopg2开发应用程序的流程.png "采用Psycopg2开发应用程序的流程") - diff --git "a/content/docs-lite/zh/docs/Developerguide/\345\274\200\345\217\221\346\265\201\347\250\213_libpq.md" "b/content/docs-lite/zh/docs/Developerguide/\345\274\200\345\217\221\346\265\201\347\250\213_libpq.md" deleted file mode 100644 index 497755bb0f81b5625f0c71d4d884e2d2d112aa5e..0000000000000000000000000000000000000000 --- "a/content/docs-lite/zh/docs/Developerguide/\345\274\200\345\217\221\346\265\201\347\250\213_libpq.md" +++ /dev/null @@ -1,31 +0,0 @@ -# 开发流程 - -编译并且链接一个libpq的源程序,需要做下面的一些事情: - -1. 解压相应的发布包(如openGauss-\*.\*.0-\*\*\*-64bit-Libpq.tar.gz)文件,其中include文件夹下的头文件为所需的头文件,lib文件夹中为所需的libpq库文件。 - - >![](public_sys-resources/icon-note.gif) **说明:** - > - >除libpq-fe.h外,include文件夹下默认还存在头文件postgres\_ext.h,gs\_thread.h,gs\_threadlocal.h,这三个头文件是libpq-fe.h的依赖文件。 - -2. 包含libpq-fe.h头文件: - - ``` - #include - ``` - -3. 通过-I_ directory_选项,提供头文件的安装位置(有些时候编译器会查找缺省的目录,因此可以忽略这些选项)。如: - - ``` - gcc -I (头文件所在目录) -L (libpq库所在目录) testprog.c -lpq - ``` - -4. 如果要使用制作文件\(makefile\),向CPPFLAGS、LDFLAGS、LIBS变量中增加如下选项: - - ``` - CPPFLAGS += -I (头文件所在目录) - LDFLAGS += -L (libpq库所在目录) - LIBS += -lpq - ``` - - diff --git "a/content/docs-lite/zh/docs/Developerguide/\345\274\200\345\217\221\350\247\204\350\214\203.md" "b/content/docs-lite/zh/docs/Developerguide/\345\274\200\345\217\221\350\247\204\350\214\203.md" deleted file mode 100644 index 72f6b97ccba9d20ef9bb019f4799860f67ddf475..0000000000000000000000000000000000000000 --- "a/content/docs-lite/zh/docs/Developerguide/\345\274\200\345\217\221\350\247\204\350\214\203.md" +++ /dev/null @@ -1,14 +0,0 @@ -# 开发规范 - -如果用户在APP的开发中,使用了连接池机制,那么需要遵循如下规范: - -- 如果在连接中设置了GUC参数,那么在将连接归还连接池之前,必须使用“SET SESSION AUTHORIZATION DEFAULT;RESET ALL;”将连接的状态清空。 -- 如果使用了临时表,那么在将连接归还连接池之前,必须将临时表删除。 - -否则,连接池里面的连接就是有状态的,会对用户后续使用连接池进行操作的正确性带来影响。 - -兼容性原则: - -- 新驱动前向兼容数据库,若需使用驱动与数据库同步增加的新特性,必须升级数据库。 -- behavior\_compat\_options='proc\_outparam\_override' 重载参数仅在A兼容模式可用。 - diff --git "a/content/docs-lite/zh/docs/Developerguide/\345\274\200\345\217\221\350\256\276\350\256\241\350\247\204\350\214\203.md" "b/content/docs-lite/zh/docs/Developerguide/\345\274\200\345\217\221\350\256\276\350\256\241\350\247\204\350\214\203.md" deleted file mode 100644 index 0058945166e0e2507eabc07717a24361a6435e9a..0000000000000000000000000000000000000000 --- "a/content/docs-lite/zh/docs/Developerguide/\345\274\200\345\217\221\350\256\276\350\256\241\350\247\204\350\214\203.md" +++ /dev/null @@ -1,8 +0,0 @@ -# 开发设计规范 - -- **[开发设计规范概述](开发设计规范概述.md)** -- **[数据库对象命名](数据库对象命名.md)** -- **[数据库对象设计](数据库对象设计.md)** -- **[SQL编写](SQL编写.md)** -- **[程序开发规范](程序开发规范.md)** - diff --git "a/content/docs-lite/zh/docs/Developerguide/\345\274\200\345\217\221\350\256\276\350\256\241\350\247\204\350\214\203\346\246\202\350\277\260.md" "b/content/docs-lite/zh/docs/Developerguide/\345\274\200\345\217\221\350\256\276\350\256\241\350\247\204\350\214\203\346\246\202\350\277\260.md" deleted file mode 100644 index b34e77dcfdb4e2a8b42020ed08be3c98f10fc04c..0000000000000000000000000000000000000000 --- "a/content/docs-lite/zh/docs/Developerguide/\345\274\200\345\217\221\350\256\276\350\256\241\350\247\204\350\214\203\346\246\202\350\277\260.md" +++ /dev/null @@ -1,9 +0,0 @@ -# 开发设计建议概述 - -本开发设计建议约定数据库建模和数据库应用程序开发过程中,应当遵守的设计规范。依据这些规范进行建模,能够更好地契合openGauss的处理架构,输出更高效的业务SQL代码。 - -本开发设计建议中所陈述的“建议”和“关注”含义如下: - -- **建议**:用户应当遵守的设计规则。遵守这些规则,能够保证业务的高效运行;违反这些规则,将导致业务性能的大幅下降或某些业务逻辑错误。 -- **关注**:在业务开发过程中客户需要注意的细则。用于标识容易导致客户理解错误的知识点(实际上遵守SQL标准的SQL行为),或者程序中潜在的客户不易感知的默认行为。 - diff --git "a/content/docs-lite/zh/docs/Developerguide/\345\274\202\346\255\245\345\221\275\344\273\244\345\244\204\347\220\206.md" "b/content/docs-lite/zh/docs/Developerguide/\345\274\202\346\255\245\345\221\275\344\273\244\345\244\204\347\220\206.md" deleted file mode 100644 index a105b1c1fdcd48ebb6f7badc01e56f36a7acfeb2..0000000000000000000000000000000000000000 --- "a/content/docs-lite/zh/docs/Developerguide/\345\274\202\346\255\245\345\221\275\344\273\244\345\244\204\347\220\206.md" +++ /dev/null @@ -1,26 +0,0 @@ -# 异步命令处理 - -PQexec函数对普通的同步应用里提交命令已经足够使用。但是它却有几个缺陷,而这些缺陷可能对某些用户很重要: - -- PQexec等待命令结束,而应用可能还有其它的工作要做(比如维护用户界面等),此时PQexec不会在原处等待响应。 - -- 因为客户端应用在等待结果的时候是处于挂起状态的,所以应用很难判断它是否该尝试结束正在进行的命令。 - -- PQexec只能返回一个PGresult结构。如果提交的命令字符串包含多个SQL命令,除了最后一个PGresult以外都会被PQexec丢弃。 - -- PQexec总是收集命令的整个结果,将其缓存在一个PGresult中。虽然这为应用简化了错误处理逻辑,但是对于包含多行的结果是不切实际的。 - - -不想受到这些限制的应用可以改用下面的函数,这些函数也是构造PQexec的函数:PQsendQuery和PQgetResult。PQsendQueryParams,PQsendPrepare,PQsendQueryPrepared也可以和PQgetResult一起使用。 - -- **[PQsendQuery](PQsendQuery.md)** - -- **[PQsendQueryParams](PQsendQueryParams.md)** - -- **[PQsendPrepare](PQsendPrepare.md)** - -- **[PQsendQueryPrepared](PQsendQueryPrepared.md)** - -- **[PQflush](PQflush.md)** - - diff --git "a/content/docs-lite/zh/docs/Developerguide/\346\211\247\350\241\214SQL\350\257\255\345\217\245_JDBC.md" "b/content/docs-lite/zh/docs/Developerguide/\346\211\247\350\241\214SQL\350\257\255\345\217\245_JDBC.md" deleted file mode 100644 index a078338f1889a0c7959078b4630a546e581df1dd..0000000000000000000000000000000000000000 --- "a/content/docs-lite/zh/docs/Developerguide/\346\211\247\350\241\214SQL\350\257\255\345\217\245_JDBC.md" +++ /dev/null @@ -1,244 +0,0 @@ -# 执行SQL语句 - -## 执行普通SQL语句 - -应用程序通过执行SQL语句来操作数据库的数据(不用传递参数的语句),需要按以下步骤执行: - -1. 调用Connection的createStatement方法创建语句对象。 - - ``` - Connection conn = DriverManager.getConnection("url","user","password"); - Statement stmt = conn.createStatement(); - ``` - -2. 调用Statement的executeUpdate方法执行SQL语句。 - - ``` - int rc = stmt.executeUpdate("CREATE TABLE customer_t1(c_customer_sk INTEGER, c_customer_name VARCHAR(32));"); - ``` - - >![](public_sys-resources/icon-note.gif) **说明:** - > - >- 数据库中收到的一次执行请求(不在事务块中),如果含有多条语句,将会被打包成一个事务,事务块中不支持vacuum操作。如果其中有一个语句失败,那么整个请求都将会被回滚。 - >- 使用Statement执行多语句时应以“;”作为各语句间的分隔符,存储过程、函数、匿名块不支持多语句执行;当preferQueryMode=simple,语句执行不走解析逻辑,此场景下无法使用";"作为多语句间的分隔符。 - >- “/”可用作创建单个存储过程、函数、匿名块的结束符。当preferQueryMode=simple,语句执行不走解析逻辑,此场景下无法使用"/"作为结束符。 - >- 在prepareThreshold=1时,因为preferQueryMode默认模式不对statement进行缓存淘汰,所以statement执行的每条SQL都会缓存语句,可能导致内存膨胀。需要调整preferQueryMode=extendedCacheEverything,对statement进行缓存淘汰 - -3. 关闭语句对象。 - - ``` - stmt.close(); - ``` - - -## 执行预编译SQL语句 - -预编译语句是只编译和优化一次,然后可以通过设置不同的参数值多次使用。由于已经预先编译好,后续使用会减少执行时间。因此,如果多次执行一条语句,请选择使用预编译语句。可以按以下步骤执行: - -1. 调用Connection的prepareStatement方法创建预编译语句对象。 - - ``` - PreparedStatement pstmt = con.prepareStatement("UPDATE customer_t1 SET c_customer_name = ? WHERE c_customer_sk = 1"); - ``` - -2. 调用PreparedStatement的setShort设置参数。 - - ``` - pstmt.setShort(1, (short)2); - ``` - -3. 调用PreparedStatement的executeUpdate方法执行预编译SQL语句。 - - ``` - int rowcount = pstmt.executeUpdate(); - ``` - -4. 调用PreparedStatement的close方法关闭预编译语句对象。 - - ``` - pstmt.close(); - ``` - - -## 调用存储过程 - -openGauss支持通过JDBC直接调用事先创建的存储过程,步骤如下: - -1. 调用Connection的prepareCall方法创建调用语句对象。 - - ``` - Connection myConn = DriverManager.getConnection("url","user","password"); - CallableStatement cstmt = myConn.prepareCall("{? = CALL TESTPROC(?,?,?)}"); - ``` - -2. 调用CallableStatement的setInt方法设置参数。 - - ``` - cstmt.setInt(2, 50); - cstmt.setInt(1, 20); - cstmt.setInt(3, 90); - ``` - -3. 调用CallableStatement的registerOutParameter方法注册输出参数。 - - ``` - cstmt.registerOutParameter(4, Types.INTEGER); //注册out类型的参数,类型为整型。 - ``` - -4. 调用CallableStatement的execute执行方法调用。 - - ``` - cstmt.execute(); - ``` - -5. 调用CallableStatement的getInt方法获取输出参数。 - - ``` - int out = cstmt.getInt(4); //获取out参数 - ``` - - 示例: - - ``` - //在数据库中已创建了如下存储过程,它带有out参数。 - create or replace procedure testproc - ( - psv_in1 in integer, - psv_in2 in integer, - psv_inout in out integer - ) - as - begin - psv_inout := psv_in1 + psv_in2 + psv_inout; - end; - / - ``` - -6. 调用CallableStatement的close方法关闭调用语句。 - - ``` - cstmt.close(); - ``` - - >![](public_sys-resources/icon-note.gif) **说明:** - > - >- 很多的数据库类如Connection、Statement和ResultSet都有close\(\)方法,在使用完对象后应把它们关闭。要注意的是,Connection的关闭将间接关闭所有与它关联的Statement,Statement的关闭间接关闭了ResultSet。 - >- 一些JDBC驱动程序还提供命名参数的方法来设置参数。命名参数的方法允许根据名称而不是顺序来设置参数,若参数有默认值,则可以不用指定参数值就可以使用此参数的默认值。即使存储过程中参数的顺序发生了变更,也不必修改应用程序。目前openGauss数据库的JDBC驱动程序不支持此方法。 - >- openGauss数据库不支持带有输出参数的函数,也不支持存储过程和函数参数默认值。 - >- myConn.prepareCall("{? = CALL TESTPROC(?,?,?)}"),执行存储过程绑定参数时,可以按照占位符的顺序绑定参数,注册第一个参数为出参,也可以按照存储过程中的参数顺序绑定参数,注册第四个参数为出参,上述用例为此场景,注册第四个参数为出参。 - - >![](public_sys-resources/icon-notice.gif) **须知:** - > - >- 当游标作为存储过程的返回值时,如果使用JDBC调用该存储过程,返回的游标将不可用。 - >- 存储过程不能和普通SQL在同一条语句中执行。 - >- 存储过程中inout类型参数必需注册出参。 - - -## Oracle兼容模式启用重载时,调用存储过程 - -打开参数behavior\_compat\_options='proc\_outparam\_override'后,JDBC调用事先创建的存储过程,步骤如下: - -1. 调用Connection的prepareCall方法创建调用语句对象。 - - ``` - Connection conn = DriverManager.getConnection("url","user","password"); - CallableStatement cs = conn.prepareCall("{ CALL TEST_PROC(?,?,?) }"); - ``` - -2. 调用CallableStatement的setInt方法设置参数。 - - ``` - PGobject pGobject = new PGobject(); - pGobject.setType("public.compfoo"); // 设置复合类型名,格式为“schema.typename”。 - pGobject.setValue("(1,demo)"); // 绑定复合类型值,格式为“(value1,value2)”。 - cs.setObject(1, pGobject); - ``` - -3. 调用CallableStatement的registerOutParameter方法注册输出参数。 - - ``` - // 注册out类型的参数,类型为复合类型,格式为“schema.typename”。 - cs.registerOutParameter(2, Types.STRUCT, "public.compfoo"); - ``` - -4. 调用CallableStatement的execute执行方法调用。 - - ``` - cs.execute(); - ``` - -5. 调用CallableStatement的getObject方法获取输出参数。 - - ``` - PGobject result = (PGobject)cs.getObject(2); // 获取out参数 - result.getValue(); // 获取复合类型字符串形式值。 - result.getArrayValue(); //获取复合类型数组形式值,以复合数据类型字段顺序排序。 - result.getStruct(); //获取复合类型子类型名,按创建顺序排序。 - ``` - -6. 调用CallableStatement的close方法关闭调用语句。 - - ``` - cs.close(); - ``` - - >![](public_sys-resources/icon-note.gif) **说明:** - > - >- oracle兼容模式开启参数后,调用存储过程必须使用\{call proc\_name\(?,?,?\)\}形式调用,调用函数必须使用\{? = call func\_name\(?,?\)\}形式调用(等号左侧的“?”为函数返回值的占位符,用于注册函数返回值)。 - >- 参数behavior\_compat\_options='proc\_outparam\_override'行为变更后,业务需要重新建立连接,否则无法正确调用存储过程和函数。 - >- 函数和存储过程中包含复合类型时,参数的绑定与注册需要使用schema.typename形式。 - - -示例: - -``` -// 在数据库创建复合数据类型。 -CREATE TYPE compfoo AS (f1 int, f3 text); -// 在数据库中已创建了如下存储过程,它带有out参数。 -create or replace procedure test_proc -( - psv_in in compfoo, - psv_out out compfoo -) -as -begin - psv_out := psv_in; -end; -/ -``` - -## 执行批处理 - -用一条预处理语句处理多条相似的数据,数据库只创建一次执行计划,节省了语句的编译和优化时间。可以按如下步骤执行: - -1. 调用Connection的prepareStatement方法创建预编译语句对象。 - - ``` - Connection conn = DriverManager.getConnection("url","user","password"); - PreparedStatement pstmt = conn.prepareStatement("INSERT INTO customer_t1 VALUES (?)"); - ``` - -2. 针对每条数据都要调用setShort设置参数,以及调用addBatch确认该条设置完毕。 - - ``` - pstmt.setShort(1, (short)2); - pstmt.addBatch(); - ``` - -3. 调用PreparedStatement的executeBatch方法执行批处理。 - - ``` - int[] rowcount = pstmt.executeBatch(); - ``` - -4. 调用PreparedStatement的close方法关闭预编译语句对象。 - - ``` - pstmt.close(); - ``` - - >![](public_sys-resources/icon-note.gif) **说明:** - > - >在实际的批处理过程中,通常不终止批处理程序的执行,否则会降低数据库的性能。因此在批处理程序时,应该关闭自动提交功能,每几行提交一次。关闭自动提交功能的语句为: conn.setAutoCommit\(false\); - - diff --git "a/content/docs-lite/zh/docs/Developerguide/\346\211\247\350\241\214SQL\350\257\255\345\217\245_Psycopg.md" "b/content/docs-lite/zh/docs/Developerguide/\346\211\247\350\241\214SQL\350\257\255\345\217\245_Psycopg.md" deleted file mode 100644 index 61a45b8b4b312f080e537ad5fc4749106db29ba7..0000000000000000000000000000000000000000 --- "a/content/docs-lite/zh/docs/Developerguide/\346\211\247\350\241\214SQL\350\257\255\345\217\245_Psycopg.md" +++ /dev/null @@ -1,5 +0,0 @@ -# 执行SQL语句 - -1. 构造操作语句,使用%s作为占位符,执行时psycopg2会用参数值智能替换掉占位符。可以添加RETURNING子句,来得到自动生成的字段值。 -2. 使用cursor.execute方法来操作一行,使用cursor.executemany方法来操作多行。 - diff --git "a/content/docs-lite/zh/docs/Developerguide/\346\225\260\346\215\256\345\272\223\345\257\271\350\261\241\345\221\275\345\220\215.md" "b/content/docs-lite/zh/docs/Developerguide/\346\225\260\346\215\256\345\272\223\345\257\271\350\261\241\345\221\275\345\220\215.md" deleted file mode 100644 index 36df974bd7aee6a26a02b3ce121f2435d6bbf607..0000000000000000000000000000000000000000 --- "a/content/docs-lite/zh/docs/Developerguide/\346\225\260\346\215\256\345\272\223\345\257\271\350\261\241\345\221\275\345\220\215.md" +++ /dev/null @@ -1,27 +0,0 @@ -# 数据库对象命名 - -数据库对象命名需要满足约束:非时序表长度不超过63个字节,时序表长度不超过53个字符,以字母或下划线开头,中间字符可以是字母、数字、下划线、$、\#。 - -- 【建议】避免使用保留或者非保留关键字命名数据库对象。 - - >![](public_sys-resources/icon-note.gif) **说明:** - > - >可以使用select \* from pg\_get\_keywords\(\)查询openGauss的关键字,或者在[关键字](../SQLReference/关键字.md)章节中查看。 - -- 【建议】避免使用双引号括起来的字符串来定义数据库对象名称,除非需要限制数据库对象名称的大小写。数据库对象名称大小写敏感会使定位问题难度增加。 -- 【建议】数据库对象命名风格务必保持统一。 - - 增量开发的业务系统或进行业务迁移的系统,建议遵守历史的命名风格。 - - 建议使用多个单词组成,以下划线分割。 - - 数据库对象名称建议能够望文知意,尽量避免使用自定义缩写(可以使用通用的术语缩写进行命名)。例如,在命名中可以使用具有实际业务含义的英文词汇或汉语拼音,但规则应该在数据库实例范围内保持一致。 - - 变量名的关键是要具有描述性,即变量名称要有一定的意义,变量名要有前缀标明该变量的类型。 - -- 【建议】表对象的命名应该可以表征该表的重要特征。例如,在表对象命名时区分该表是普通表、临时表还是非日志表: - - 普通表名按照数据集的业务含义命名。 - - 临时表以“tmp\_+后缀”命名。 - - 非日志表以“ul\_+后缀”命名。 - - 外表以“f\_+后缀”命名。 - - 不创建以redis\_为前缀的数据库对象。 - - 不创建以mlog\_和以matviewmap\_为前缀的数据库对象。 - -- 【建议】非时序表对象命名建议不要超过63字节。如果过该长度内核会对表名进行截断,从而造成和设置值不一致的现象。且在不同字符集下,可能造成字符被截断,出现预期外的字符。 - diff --git "a/content/docs-lite/zh/docs/Developerguide/\346\225\260\346\215\256\345\272\223\345\257\271\350\261\241\350\256\276\350\256\241.md" "b/content/docs-lite/zh/docs/Developerguide/\346\225\260\346\215\256\345\272\223\345\257\271\350\261\241\350\256\276\350\256\241.md" deleted file mode 100644 index 0bf6e00cbb737106db69cbb4e879737b6bb68cc4..0000000000000000000000000000000000000000 --- "a/content/docs-lite/zh/docs/Developerguide/\346\225\260\346\215\256\345\272\223\345\257\271\350\261\241\350\256\276\350\256\241.md" +++ /dev/null @@ -1,13 +0,0 @@ -# 数据库对象设计 - -- **[Database和Schema设计](Database和Schema设计.md)** - -- **[表设计](表设计.md)** - -- **[字段设计](字段设计.md)** - -- **[约束设计](约束设计.md)** - -- **[视图和关联表设计](视图和关联表设计.md)** - - diff --git "a/content/docs-lite/zh/docs/Developerguide/\346\225\260\346\215\256\345\272\223\346\211\247\350\241\214\350\257\255\345\217\245\345\207\275\346\225\260.md" "b/content/docs-lite/zh/docs/Developerguide/\346\225\260\346\215\256\345\272\223\346\211\247\350\241\214\350\257\255\345\217\245\345\207\275\346\225\260.md" deleted file mode 100644 index 6955e54a569e23f5a6bd7717b18f6afcee393323..0000000000000000000000000000000000000000 --- "a/content/docs-lite/zh/docs/Developerguide/\346\225\260\346\215\256\345\272\223\346\211\247\350\241\214\350\257\255\345\217\245\345\207\275\346\225\260.md" +++ /dev/null @@ -1,29 +0,0 @@ -# **数据库执行语句函数** - -与数据库服务器的连接成功建立,便可以使用这里描述的函数执行SQL查询和命令。 - -- **[PQclear](PQclear.md)** - -- **[PQexec](PQexec.md)** - -- **[PQexecParams](PQexecParams.md)** - -- **[PQexecParamsBatch](PQexecParamsBatch.md)** - -- **[PQexecPrepared](PQexecPrepared.md)** - -- **[PQexecPreparedBatch](PQexecPreparedBatch.md)** - -- **[PQfname](PQfname.md)** - -- **[PQgetvalue](PQgetvalue.md)** - -- **[PQnfields](PQnfields.md)** - -- **[PQntuples](PQntuples.md)** - -- **[PQprepare](PQprepare.md)** - -- **[PQresultStatus](PQresultStatus.md)** - - diff --git "a/content/docs-lite/zh/docs/Developerguide/\346\225\260\346\215\256\345\272\223\350\277\236\346\216\245\346\216\247\345\210\266\345\207\275\346\225\260.md" "b/content/docs-lite/zh/docs/Developerguide/\346\225\260\346\215\256\345\272\223\350\277\236\346\216\245\346\216\247\345\210\266\345\207\275\346\225\260.md" deleted file mode 100644 index 44b84443dd0881595008be5282fc338ddd2ecf9f..0000000000000000000000000000000000000000 --- "a/content/docs-lite/zh/docs/Developerguide/\346\225\260\346\215\256\345\272\223\350\277\236\346\216\245\346\216\247\345\210\266\345\207\275\346\225\260.md" +++ /dev/null @@ -1,23 +0,0 @@ -# 数据库连接控制函数 - -数据库连接控制函数控制与openGauss服务器链接的事情。一个应用程序一次可以与多个服务器建立链接,如一个客户端链接多个数据库的场景。每个链接都是用一个从函数PQconnectdb、PQconnectdbParams或PQsetdbLogin获得的PGconn对象表示。注意,这些函数总是返回一个非空的对象指针,除非内存分配失败,会返回一个空的指针。链接建立的接口保存在PGconn对象中,可以调用PQstatus函数来检查一下返回值看看连接是否成功。 - -- **[PQconnectdbParams](PQconnectdbParams.md)** - -- **[PQconnectdb](PQconnectdb.md)** - -- **[PQconninfoParse](PQconninfoParse.md)** - -- **[PQconnectStart](PQconnectStart.md)** - -- **[PQerrorMessage](PQerrorMessage.md)** - -- **[PQsetdbLogin](PQsetdbLogin.md)** - -- **[PQfinish](PQfinish.md)** - -- **[PQreset](PQreset.md)** - -- **[PQstatus](PQstatus.md)** - - diff --git "a/content/docs-lite/zh/docs/Developerguide/\346\225\260\346\215\256\346\237\245\350\257\242\350\257\267\346\261\202\345\244\204\347\220\206\350\277\207\347\250\213.md" "b/content/docs-lite/zh/docs/Developerguide/\346\225\260\346\215\256\346\237\245\350\257\242\350\257\267\346\261\202\345\244\204\347\220\206\350\277\207\347\250\213.md" deleted file mode 100644 index b2a7c763cfb650b2ff6d464a4e636fcba95e7628..0000000000000000000000000000000000000000 --- "a/content/docs-lite/zh/docs/Developerguide/\346\225\260\346\215\256\346\237\245\350\257\242\350\257\267\346\261\202\345\244\204\347\220\206\350\277\207\347\250\213.md" +++ /dev/null @@ -1,5 +0,0 @@ -# 数据查询请求处理过程 - -**图 1** openGauss服务响应流程 -![](figures/openGauss服务响应流程.jpg "openGauss服务响应流程") - diff --git "a/content/docs-lite/zh/docs/Developerguide/\346\227\245\345\277\227\347\256\241\347\220\206.md" "b/content/docs-lite/zh/docs/Developerguide/\346\227\245\345\277\227\347\256\241\347\220\206.md" deleted file mode 100644 index 32a51e50ad246aac4475c6deaab4fdf0f773f4d4..0000000000000000000000000000000000000000 --- "a/content/docs-lite/zh/docs/Developerguide/\346\227\245\345\277\227\347\256\241\347\220\206.md" +++ /dev/null @@ -1,225 +0,0 @@ -# 日志管理 - -openGauss JDBC驱动程序支持使用日志记录来帮助解决在应用程序中使用openGauss JDBC驱动程序时的问题。openGauss JDBC支持如下三种日志管理方式: - -1. 对接应用程序使用的SLF4J日志框架。 -2. 对接应用程序使用的JdkLogger日志框架。 - -SLF4J和JdkLogger是业界Java应用程序日志管理的主流框架,描述应用程序如何使用这些框架超出了本文范围,用户请参考对应的官方文档(SLF4J:[http://www.slf4j.org/manual.html](http://www.slf4j.org/manual.html),JdkLogger:[https://docs.oracle.com/javase/8/docs/technotes/guides/logging/overview.html](https://docs.oracle.com/javase/8/docs/technotes/guides/logging/overview.html))。 - -方式一:对接应用程序的SLF4J日志框架。 - -在建立连接时,url配置logger=Slf4JLogger。 - -可采用Log4j或Log4j2来实现SLF4J。当采用Log4j实现SLF4J,需要添加如下jar包:log4j-\*.jar、slf4j-api-\*.jar、slf4j-log4\*-\*.jar,(\*区分版本),和配置文件:log4j.properties。若采用Log4j2实现SLF4J,需要添加如下jar包:log4j-api-\*.jar、log4j-core-\*.jar、log4j-slf4j18-impl-\*.jar、slf4j-api-\*-alpha1.jar(\*区分版本),和配置文件:log4j2.xml。 - -此方式支持日志管控。SLF4J可通过文件中的相关配置实现强大的日志管控功能,建议使用此方式进行日志管理。 - ->![](public_sys-resources/icon-caution.gif) **注意:** -> ->此方式依赖slf4j的通用API接口,如org.slf4j.LoggerFactory.getLogger\(String name\)、org.slf4j.Logger.debug\(String var1\)、org.slf4j.Logger.info\(String var1\)、org.slf4j.Logger.warn\(String warn\)、org.slf4j.Logger.warn\(String warn\)等,若以上接口发生变更,日志将无法打印。 - -示例: - -``` -public static Connection GetConnection(String username, String passwd){ - - String sourceURL = "jdbc:postgresql://10.10.0.13:8000/postgres?logger=Slf4JLogger"; - Connection conn = null; - - try{ - //创建连接 - conn = DriverManager.getConnection(sourceURL,username,passwd); - System.out.println("Connection succeed!"); - }catch (Exception e){ - e.printStackTrace(); - return null; - } - return conn; -} -``` - -log4j.properties示例: - -``` -log4j.logger.org.postgresql=ALL, log_gsjdbc - -# 默认文件输出配置 -log4j.appender.log_gsjdbc=org.apache.log4j.RollingFileAppender -log4j.appender.log_gsjdbc.Append=true -log4j.appender.log_gsjdbc.File=gsjdbc.log -log4j.appender.log_gsjdbc.Threshold=TRACE -log4j.appender.log_gsjdbc.MaxFileSize=10MB -log4j.appender.log_gsjdbc.MaxBackupIndex=5 -log4j.appender.log_gsjdbc.layout=org.apache.log4j.PatternLayout -log4j.appender.log_gsjdbc.layout.ConversionPattern=%d %p %t %c - %m%n -log4j.appender.log_gsjdbc.File.Encoding = UTF-8 -``` - -log4j2.xml示例: - -``` - - - - - - - - - - - - - - - - - - - - - - - - - - - - -``` - -方式二:对接应用程序使用的JdkLogger日志框架。 - -默认的Java日志记录框架将其配置存储在名为logging.properties的文件中。Java会在Java安装目录的文件夹中安装全局配置文件。logging.properties文件也可以创建并与单个项目一起存储。 - -logging.properties配置示例: - -``` -# 指定处理程序为文件。 -handlers= java.util.logging.FileHandler - -# 指定默认全局日志级别 -.level= ALL - -# 指定日志输出管控标准 -java.util.logging.FileHandler.level=ALL -java.util.logging.FileHandler.pattern = gsjdbc.log -java.util.logging.FileHandler.limit = 500000 -java.util.logging.FileHandler.count = 30 -java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter -java.util.logging.FileHandler.append=false - -``` - -代码中使用示例: - -``` -System.setProperty("java.util.logging.FileHandler.pattern","jdbc.log"); -FileHandler fileHandler = new FileHandler(System.getProperty("java.util.logging.FileHandler.pattern")); -Formatter formatter = new SimpleFormatter(); -fileHandler.setFormatter(formatter); -Logger logger = Logger.getLogger("org.postgresql"); -logger.addHandler(fileHandler); -logger.setLevel(Level.ALL); -logger.setUseParentHandlers(false); -``` - -## 链路跟踪功能 - -openGauss JDBC驱动程序提供了应用到数据库的链路跟踪功能,用于将数据库端离散的SQL和应用程序的请求关联起来。该功能需要应用开发者实现org.postgresql.log.Tracer接口类,并在url中指定接口实现类的全限定名。 - -url示例: - -``` -String URL = "jdbc:postgresql://127.0.0.1:8000/postgres?traceInterfaceClass=xxx.xxx.xxx.OpenGaussTraceImpl"; -``` - -org.postgresql.log.Tracer接口类定义如下: - -``` -public interface Tracer { -// Retrieves the value of traceId. -String getTraceId(); -} -``` - -org.postgresql.log.Tracer接口实现类示例: - -``` -import org.postgresql.log.Tracer; - -public class OpenGaussTraceImpl implements Tracer { - private static MDC mdc = new MDC(); - - private final String TRACE_ID_KEY = "traceId"; - - public void set(String traceId) { - mdc.put(TRACE_ID_KEY, traceId); - } - - public void reset() { - mdc.clear(); - } - - @Override - public String getTraceId() { - return mdc.get(TRACE_ID_KEY); - } -} -``` - -上下文映射示例,用于存放不同请求的生成的traceId。 - -``` -import java.util.HashMap; - -public class MDC { - static final private ThreadLocal> threadLocal = new ThreadLocal<>(); - - public void put(String key, String val) { - if (key == null || val == null) { - throw new IllegalArgumentException("key or val cannot be null"); - } else { - if (threadLocal.get() == null) { - threadLocal.set(new HashMap<>()); - } - threadLocal.get().put(key, val); - } - } - - public String get(String key) { - if (key == null) { - throw new IllegalArgumentException("key cannot be null"); - } else if (threadLocal.get() == null) { - return null; - } else { - return threadLocal.get().get(key); - } - } - - public void clear() { - if (threadLocal.get() == null) { - return; - } else { - threadLocal.get().clear(); - } - } -} -``` - -业务使用traceId示例。 - -``` -String traceId = UUID.randomUUID().toString().replaceAll("-", ""); -openGaussTrace.set(traceId); -pstm = con.prepareStatement("select * from test_trace_id where id = ?"); -pstm.setInt(1, 1); -pstm.execute(); -pstm = con.prepareStatement("insert into test_trace_id values(?,?)"); -pstm.setInt(1, 2); -pstm.setString(2, "test"); -pstm.execute(); -openGaussTrace.reset(); -``` - diff --git "a/content/docs-lite/zh/docs/Developerguide/\347\244\272\344\276\213-jdbc\344\270\273\345\244\207\351\233\206\347\276\244\350\264\237\350\275\275\345\235\207\350\241\241.md" "b/content/docs-lite/zh/docs/Developerguide/\347\244\272\344\276\213-jdbc\344\270\273\345\244\207\351\233\206\347\276\244\350\264\237\350\275\275\345\235\207\350\241\241.md" deleted file mode 100644 index 31c8702a3fe0a4b7fd798eb64fbe7cd1ab619237..0000000000000000000000000000000000000000 --- "a/content/docs-lite/zh/docs/Developerguide/\347\244\272\344\276\213-jdbc\344\270\273\345\244\207\351\233\206\347\276\244\350\264\237\350\275\275\345\235\207\350\241\241.md" +++ /dev/null @@ -1,89 +0,0 @@ -# 示例:jdbc主备集群负载均衡 - ->![](public_sys-resources/icon-note.gif) **说明:** ->以下示例场景中node代表“host:port”,host为数据库服务器名称或IP地址,port为数据库服务器端口。 - - -## jdbc负载均衡功能说明 - -jdbc可以通过URL中设置多个数据库节点,实现对主备集群的访问。通过在URL设置负载均衡参数"autoBalance",jdbc可以在建立连接时,依照特定的负载均衡规则将客户端与主备集群的连接依次建立在URL中的各个节点上,以此实现连接的负载均衡。 -默认值为"false",此时jdbc始终与URL中配置的同一个满足建连条件的节点建立连接。连接主备集群时,使用此参数需要保证业务中没有写操作,或者与targetServerType=slave配合,限制客户端只连接备机。目前,jdbc提供了roundrobin、priority roundrobin、leastconn、shuffle四种负载均衡模式,示例如下: -* roundrobin -轮询模式,即与URL串上的候选节点轮流建立连接。取值:"roundrobin"、"true"、"balance"。 - * 假如客户端想使用轮询模式连接一主两备集群,并且多次创建连接时可以轮流选择集群中的节点建连,可以使用如下配置: - ``` - jdbc:opengauss://node1,node2,node3/database?autoBalance=roundrobin - ``` - * 假如客户端想使用轮询模式只连接一主两备集群的备机,对备机做只读操作,可以使用如下配置: - ``` - jdbc:opengauss://node1,node2,node3/database?autoBalance=roundrobin&targetServerType=slave - ``` - * 假如客户端想使用轮询模式只连接一主两备集群的主机,避免写操作路由到备机,可以使用如下配置: - ``` - jdbc:opengauss://node1,node2,node3/database?autoBalance=roundrobin&targetServerType=master - ``` -* shuffle: -随机模式,每次都随机选择URL串中的某个节点建立连接。取值:"shuffle"。使用随机模式连接一主两备集群的参考配置如下: -``` -jdbc:opengauss://node1,node2,node3/database?autoBalance=shuffle -``` -* leastconn:最小连接模式,对候选节点依照各节点有效连接数做优先级排序,优先与连接数少的节点建立连接。 -该模式会统计通过当前驱动在当前集群内使用leastconn模式建立的连接,并定时检查这些连接的有效性。取值:"leastconn"。使用最小连接模式连接一主两备集群的参考配置如下: -``` -jdbc:opengauss://node1,node2,node3/database?autoBalance=leastconn -``` -* priority roundrobin::带优先级的轮询模式,优先对前n个候选节点做轮询建连,取值:"proprity[n]",n为非负整数。以一主两备集群为例,如果客户端想要优先在主机和备机1上执行业务,备机2只作为其他节点异常时的备用节点,可以设置该参数: - -``` -jdbc:opengauss://node1,node2,node3/database?autoBalance=priority2 -``` - ->![](public_sys-resources/icon-caution.gif) **注意:** ->- jdbc负载均衡根据url串中指定的节点集合识别集群,如果存在多个指定了相同节点集合和相同负载均衡模式的URL分别通过同一驱动建立连接,则jdbc会将其视为同一集群上的连接,并整体进行负载均衡。 ->- jdbc支持的负载均衡是驱动级别的负载均衡,会对基于该驱动在同一集群上创建的连接负载均衡,不会基于该集群中各节点的实际连接数负载均衡,也不会基于其他驱动创建的连接负载均衡。 ->- leastconn模式会开启心跳线程,每20秒执行一次监测连接有效性等定时任务。该功能的关闭机制为:心跳线程连续两次监测到已缓存的开启leastconn的连接数为0,则关闭心跳线程并清空leastconn功能缓存信息。 - -## 集群状态变化时,jdbc快速负载均衡功能说明 - -该功能主要针对使用连接池连接主备集群并设置了最小连接模式的场景:连接池通常会维护一定数量的长连接,当集群中某个节点失效时,连接池会在剩余节点上重新创建连接。当失效节点恢复时,由于连接池已经在其他节点上创建了足够数量的长连接,因此除非部分原有连接被主动关闭,新恢复节点会始终处于空闲状态。 -该功能开启时,jdbc会定时检测URL中配置的节点的状态。当检测到节点恢复时,jdbc会筛选其他节点上的空闲连接并关闭。连接池感知到缓存连接减少后,会基于leastconn模式在新恢复节点上创建连接,使集群重新负载均衡。该功能由"enableQuickAutoBalance"、"maxIdleTimeBeforeTerminal"、"minReservedConPerCluster"和 "minReservedConPerDatanode"配合使用,具体说明如下: -* enableQuickAutoBalance:是否开启集群变化时,jdbc快速负载均衡功能。该功能必须与最小连接模式配合使用:设置为"true"且autoBalance设置为"leastconn"时,功能开启。参数针对连接生效。 - - 取值范围:{"true", "false"}。 - - 默认值:"false"。 - -* maxIdleTimeBeforeTerminal:jdbc触发快速负载均衡时,可保留连接的最大空闲时长。jdbc快速负载均衡功能筛选空闲连接时,会将处于idle状态并且持续时间大于等于maxIdleTimeBeforeTerminal的连接视为空闲连接,这些连接可能会被jdbc关闭。该参数只在autoBalance设置为"leastconn"且enableQuickAutoBalance设置为"true"时生效。参数针对连接生效。 - - 单位:秒。 - - 取值范围:[0, 9223372036854775)内的整数。 - - 默认值:30。 - -* minReservedConPerCluster:jdbc触发快速负载均衡时,集群内空闲连接的最小保留百分比。默认情况下,jdbc触发快速负载均衡时,所有被筛选出来的空闲连接都会被关闭。设置该参数可以在触发快速负载均衡时,jdbc至少保留集群内空闲连接的minReservedConPerCluster%。该参数针对集群生效,如果存在多个配置了相同节点并开启快速负载均衡功能的URL都设置了该参数,则取最小值。 - - 取值范围:[0, 100]内的整数。 - - 默认值:0。 - -* minReservedConPerDatanode:jdbc触发快速负载均衡时,节点内空闲连接的最小保留百分比。设置该参数可以在触发快速负载均衡时,jdbc会至少保留每个节点内空闲连接的minReservedConPerDatanode%。如果URL串同时设置了minReservedConPerDatanode和minReservedConPerCluster,jdbc会保证最终筛选出来的待关闭连接同时满足两个参数。该参数针对集群生效,如果存在多个配置了相同节点并开启快速负载均衡功能的URL都设置了该参数,则取最小值。 - - 取值范围:[0, 100]内的整数。 - - 默认值:0。 - -下面是jdbc开启快速负载均衡的简单用例,通过以下配置可以在jdcb建立连接时同时开启最小连接模式和集群状态变化时的快速负载均衡功能。功能开启后,jdbc会缓存通过该url创建的有效连接,并定时查询node1、node2、node3的状态。当监测到节点恢复时,jdbc会从缓存连接中筛选空闲连接(默认情况处于idle状态超过30秒)并关闭。由连接池基于leastconn模式新建连接,实现集群内连接数再平衡。 -``` -jdbc:opengauss://node1,node2,node3/database?autoBalance=leastconn&enableQuickAutoBalance=true -``` -此外可以通过设置额外参数,来控制空闲连接的筛选标准以及集群和每个节点内空闲连接的关闭比例: -``` -jdbc:opengauss://node1,node2,node3/database?autoBalance=leastconn&enableQuickAutoBalance=true&maxIdleTimeBeforeTerminal=20&minReservedConPerCluster=20&minReservedConPerDatanode=20 -``` - ->![](public_sys-resources/icon-caution.gif) **注意:** ->- jdbc只基于该驱动在同一集群上的连接负载均衡,同样触发快速负载均衡时,也只会关闭该驱动在某一集群上创建、并设置了相应参数的连接。 ->- 该功能需要通过调整参数来适应客户端的业务需求,jdbc本身无法感知到某一连接是否为实际业务所需的连接, 因此通过判断空闲连接的方式筛选可关闭连接。如果参数与实际业务需求不匹配,可能会出现用户持有连接被关闭的情况。 ->- jdbc在进行快速负载均衡时,会根据设置的配置参数,筛选部分满足条件的连接关闭,如果此时大部分已有连接都不满足关闭条件,比如全部处于活跃状态,可能导致快速负载均衡结果较差。 ->- jdbc快速负载均衡功能会额外开启心跳线程用于分阶段关闭空闲连接。由于快速负载均衡依赖于leastconn模式,因此该功能的关闭机制与leastconn模式相同。 \ No newline at end of file diff --git "a/content/docs-lite/zh/docs/Developerguide/\347\244\272\344\276\213-libpq.md" "b/content/docs-lite/zh/docs/Developerguide/\347\244\272\344\276\213-libpq.md" deleted file mode 100644 index f969d41e5ee6bfdc8b35ae1b2bd069edc1e14b36..0000000000000000000000000000000000000000 --- "a/content/docs-lite/zh/docs/Developerguide/\347\244\272\344\276\213-libpq.md" +++ /dev/null @@ -1,274 +0,0 @@ -# 示例 - -## 常用功能示例代码 - -示例1: - -``` -/* - * testlibpq.c - */ -#include -#include -#include - -static void -exit_nicely(PGconn *conn) -{ - PQfinish(conn); - exit(1); -} - -int -main(int argc, char **argv) -{ - const char *conninfo; - PGconn *conn; - PGresult *res; - int nFields; - int i,j; - - /* - * 用户在命令行上提供了conninfo字符串的值时使用该值 - * 否则环境变量或者所有其它连接参数 - * 都使用缺省值。 - */ - if (argc > 1) - conninfo = argv[1]; - else - conninfo = "dbname=postgres port=42121 host='10.44.133.171' application_name=test connect_timeout=5 sslmode=allow user='test' password='test_1234'"; - - /* 连接数据库 */ - conn = PQconnectdb(conninfo); - - /* 检查后端连接成功建立 */ - if (PQstatus(conn) != CONNECTION_OK) - { - fprintf(stderr, "Connection to database failed: %s", - PQerrorMessage(conn)); - exit_nicely(conn); - } - - /* - * 测试实例涉及游标的使用时候必须使用事务块 - *把全部放在一个 "select * from pg_database" - * PQexec() 里,过于简单,不推荐使用 - */ - - /* 开始一个事务块 */ - res = PQexec(conn, "BEGIN"); - if (PQresultStatus(res) != PGRES_COMMAND_OK) - { - fprintf(stderr, "BEGIN command failed: %s", PQerrorMessage(conn)); - PQclear(res); - exit_nicely(conn); - } - - /* - * 在结果不需要的时候PQclear PGresult,以避免内存泄漏 - */ - PQclear(res); - - /* - * 从系统表 pg_database(数据库的系统目录)里抓取数据 - */ - res = PQexec(conn, "DECLARE myportal CURSOR FOR select * from pg_database"); - if (PQresultStatus(res) != PGRES_COMMAND_OK) - { - fprintf(stderr, "DECLARE CURSOR failed: %s", PQerrorMessage(conn)); - PQclear(res); - exit_nicely(conn); - } - PQclear(res); - - res = PQexec(conn, "FETCH ALL in myportal"); - if (PQresultStatus(res) != PGRES_TUPLES_OK) - { - fprintf(stderr, "FETCH ALL failed: %s", PQerrorMessage(conn)); - PQclear(res); - exit_nicely(conn); - } - - /* 打印属性名称 */ - nFields = PQnfields(res); - for (i = 0; i < nFields; i++) - printf("%-15s", PQfname(res, i)); - printf("\n\n"); - - /* 打印行 */ - for (i = 0; i < PQntuples(res); i++) - { - for (j = 0; j < nFields; j++) - printf("%-15s", PQgetvalue(res, i, j)); - printf("\n"); - } - - PQclear(res); - - /* 关闭入口 ... 不用检查错误 ... */ - res = PQexec(conn, "CLOSE myportal"); - PQclear(res); - - /* 结束事务 */ - res = PQexec(conn, "END"); - PQclear(res); - - /* 关闭数据库连接并清理 */ - PQfinish(conn); - - return 0; -} -``` - -示例2: - -``` -/* - * testlibpq2.c - * 测试外联参数和二进制I/O。 - * - * 在运行这个例子之前,用下面的命令填充一个数据库 - * - * - * CREATE TABLE test1 (i int4, t text); - * - * INSERT INTO test1 values (2, 'ho there'); - * - * 期望的输出如下 - * - * - * tuple 0: got - * i = (4 bytes) 2 - * t = (8 bytes) 'ho there' - * - */ -#include -#include -#include -#include -#include - -/* for ntohl/htonl */ -#include -#include - -static void -exit_nicely(PGconn *conn) -{ - PQfinish(conn); - exit(1); -} - -/* - * 这个函数打印查询结果,这些结果是二进制格式,从上面的 - * 注释里面创建的表中抓取出来的 - */ -static void -show_binary_results(PGresult *res) -{ - int i; - int i_fnum, - t_fnum; - - /* 使用 PQfnumber 来避免对结果中的字段顺序进行假设 */ - i_fnum = PQfnumber(res, "i"); - t_fnum = PQfnumber(res, "t"); - - for (i = 0; i < PQntuples(res); i++) - { - char *iptr; - char *tptr; - int ival; - - /* 获取字段值(忽略可能为空的可能) */ - iptr = PQgetvalue(res, i, i_fnum); - tptr = PQgetvalue(res, i, t_fnum); - - /* - * INT4 的二进制表现形式是网络字节序 - * 建议转换成本地字节序 - */ - ival = ntohl(*((uint32_t *) iptr)); - - /* - * TEXT 的二进制表现形式是文本,因此libpq能够给它附加一个字节零 - * 把它看做 C 字符串 - * - */ - - printf("tuple %d: got\n", i); - printf(" i = (%d bytes) %d\n", - PQgetlength(res, i, i_fnum), ival); - printf(" t = (%d bytes) '%s'\n", - PQgetlength(res, i, t_fnum), tptr); - printf("\n\n"); - } -} - -int -main(int argc, char **argv) -{ - const char *conninfo; - PGconn *conn; - PGresult *res; - const char *paramValues[1]; - int paramLengths[1]; - int paramFormats[1]; - uint32_t binaryIntVal; - - /* - * 如果用户在命令行上提供了参数, - * 那么使用该值为conninfo 字符串;否则 - * 使用环境变量或者缺省值。 - */ - if (argc > 1) - conninfo = argv[1]; - else - conninfo = "dbname=postgres port=42121 host='10.44.133.171' application_name=test connect_timeout=5 sslmode=allow user='test' password='test_1234'"; - - /* 和数据库建立连接 */ - conn = PQconnectdb(conninfo); - - /* 检查与服务器的连接是否成功建立 */ - if (PQstatus(conn) != CONNECTION_OK) - { - fprintf(stderr, "Connection to database failed: %s", - PQerrorMessage(conn)); - exit_nicely(conn); - } - - /* 把整数值 "2" 转换成网络字节序 */ - binaryIntVal = htonl((uint32_t) 2); - - /* 为 PQexecParams 设置参数数组 */ - paramValues[0] = (char *) &binaryIntVal; - paramLengths[0] = sizeof(binaryIntVal); - paramFormats[0] = 1; /* 二进制 */ - - res = PQexecParams(conn, - "SELECT * FROM test1 WHERE i = $1::int4", - 1, /* 一个参数 */ - NULL, /* 让后端推导参数类型 */ - paramValues, - paramLengths, - paramFormats, - 1); /* 要求二进制结果 */ - - if (PQresultStatus(res) != PGRES_TUPLES_OK) - { - fprintf(stderr, "SELECT failed: %s", PQerrorMessage(conn)); - PQclear(res); - exit_nicely(conn); - } - - show_binary_results(res); - - PQclear(res); - - /* 关闭与数据库的连接并清理 */ - PQfinish(conn); - - return 0; -} -``` - diff --git "a/content/docs-lite/zh/docs/Developerguide/\347\244\272\344\276\213-\344\270\215\345\220\214\345\234\272\346\231\257\344\270\213\350\277\236\346\216\245\346\225\260\346\215\256\345\272\223\345\217\202\346\225\260\351\205\215\347\275\256.md" "b/content/docs-lite/zh/docs/Developerguide/\347\244\272\344\276\213-\344\270\215\345\220\214\345\234\272\346\231\257\344\270\213\350\277\236\346\216\245\346\225\260\346\215\256\345\272\223\345\217\202\346\225\260\351\205\215\347\275\256.md" deleted file mode 100644 index 9e41f63ea6ace7304a708ce6ad9407b402249385..0000000000000000000000000000000000000000 --- "a/content/docs-lite/zh/docs/Developerguide/\347\244\272\344\276\213-\344\270\215\345\220\214\345\234\272\346\231\257\344\270\213\350\277\236\346\216\245\346\225\260\346\215\256\345\272\223\345\217\202\346\225\260\351\205\215\347\275\256.md" +++ /dev/null @@ -1,62 +0,0 @@ -# 示例:不同场景下连接数据库参数配置 - ->![](public_sys-resources/icon-note.gif) **说明:** -> ->以下示例场景中node代表“host:port”,host为数据库服务器名称或IP地址,port为数据库服务器端口。 - -## 容灾场景 - -某客户有两套数据库数据库实例,其中A数据库实例为生产数据库实例,B数据库实例为容灾数据库实例。当客户执行容灾切换时,A数据库实例将降为容灾数据库实例,B数据库实例将升为生产数据库实例。此时为了避免修改配置文件导致的应用重启或重新发版。客户可在初始配置文件时,即将A、B数据库实例写入连接串中。此时在主数据库实例不可连接时,驱动将尝试对容灾数据库实例建连。例如A数据库实例为\{node1,node2,node3\}。B数据库实例为\{node4,node5,node6\}。 - -则url可参考如下进行配置: - -``` -jdbc:postgresql://node1,node2,node3,node4,node5,node6/database?priorityServers=3 -``` - ->![](public_sys-resources/icon-note.gif) **说明:** -> ->轻量版场景下,openGauss不支持容灾场景。 - -## 负载均衡场景 - -某客户存在一套集中式数据库实例,包含1主2备三个节点\{node1,node2,node3\},其中node1为主节点,node2、node3为备节点。 - -客户希望同一应用程序上建立的连接,较为均匀的分布在三个节点上,则url可参考如下配置: - -``` -jdbc:postgresql://node1,node2,node3/database?loadBalanceHosts=true -``` - ->![](public_sys-resources/icon-caution.gif) **注意:** -> ->使用loadBalanceHosts时,若连接建立在备DN上,将无法执行写操作。如果业务需要执行读写操作,请勿配置该参数。 - -## 日志诊断场景 - -某客户在使用中出现数据导入慢或出现一些难以分析的异常报错,可通过开启trace日志进行诊断,url可参考如下进行配置。 - -``` -jdbc:postgresql://node1/database?loggerLevel=trace&loggerFile=jdbc.log -``` - -## 高性能场景 - -某客户对于相同sql可能多次执行,仅是传参不同,为了提升执行效率,可开启prepareThreshold参数,避免重复生成执行计划,url可参考如下配置。 - -``` -jdbc:postgresql://node1/database?prepareThreshold=5 -``` - -某客户一次查询1000万数据,为避免同时返回造成内存溢出,可使用defaultRowFetchSize,url可参考如下配置。 - -``` -jdbc:postgresql://node1/database?defaultRowFetchSize=50000 -``` - -某客户需要批量插入1000万数据,为提升效率,可使用batchMode,url可参考如下配置。 - -``` -jdbc:postgresql://node1/database?batchMode=true -``` - diff --git "a/content/docs-lite/zh/docs/Developerguide/\347\244\272\344\276\213-\344\273\216MY\350\277\201\347\247\273\346\225\260\346\215\256.md" "b/content/docs-lite/zh/docs/Developerguide/\347\244\272\344\276\213-\344\273\216MY\350\277\201\347\247\273\346\225\260\346\215\256.md" deleted file mode 100644 index 2155765c1533f6c9a1be29edc1a9975f4367107d..0000000000000000000000000000000000000000 --- "a/content/docs-lite/zh/docs/Developerguide/\347\244\272\344\276\213-\344\273\216MY\350\277\201\347\247\273\346\225\260\346\215\256.md" +++ /dev/null @@ -1,91 +0,0 @@ -# 示例:从MY迁移数据 - -下面示例演示如何通过CopyManager从MY向openGauss进行数据迁移。 - -``` -import java.io.StringReader; -import java.sql.Connection; -import java.sql.DriverManager; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; - -import org.postgresql.copy.CopyManager; -import org.postgresql.core.BaseConnection; - -public class Migration{ - - public static void main(String[] args) { - String url = new String("jdbc:postgresql://10.180.155.74:8000/postgres"); //数据库URL - String user = new String("jack"); //openGauss用户名 - String pass = new String("xxxxxxxxx"); //openGauss密码 - String tablename = new String("migration_table"); //定义表信息 - String delimiter = new String("|"); //定义分隔符 - String encoding = new String("UTF8"); //定义字符集 - String driver = "org.postgresql.Driver"; - StringBuffer buffer = new StringBuffer(); //定义存放格式化数据的缓存 - - try { - //获取源数据库查询结果集 - ResultSet rs = getDataSet(); - - //遍历结果集,逐行获取记录 - //将每条记录中各字段值,按指定分隔符分割,由换行符结束,拼成一个字符串 - //把拼成的字符串,添加到缓存buffer - while (rs.next()) { - buffer.append(rs.getString(1) + delimiter - + rs.getString(2) + delimiter - + rs.getString(3) + delimiter - + rs.getString(4) - + "\n"); - } - rs.close(); - - try { - //建立目标数据库连接 - Class.forName(driver); - Connection conn = DriverManager.getConnection(url, user, pass); - BaseConnection baseConn = (BaseConnection) conn; - baseConn.setAutoCommit(false); - - //初始化表信息 - String sql = "Copy " + tablename + " from STDIN DELIMITER " + "'" + delimiter + "'" + " ENCODING " + "'" + encoding + "'"; - - //提交缓存buffer中的数据 - CopyManager cp = new CopyManager(baseConn); - StringReader reader = new StringReader(buffer.toString()); - cp.copyIn(sql, reader); - baseConn.commit(); - reader.close(); - baseConn.close(); - } catch (ClassNotFoundException e) { - e.printStackTrace(System.out); - } catch (SQLException e) { - e.printStackTrace(System.out); - } - - } catch (Exception e) { - e.printStackTrace(); - } - } - - //******************************** - // 从源数据库返回查询结果集 - //********************************* - private static ResultSet getDataSet() { - ResultSet rs = null; - try { - Class.forName("com.MY.jdbc.Driver").newInstance(); - Connection conn = DriverManager.getConnection("jdbc:MY://10.119.179.227:3306/jack?useSSL=false&allowPublicKeyRetrieval=true", "jack", "xxxxxxxxx"); - Statement stmt = conn.createStatement(); - rs = stmt.executeQuery("select * from migration_table"); - } catch (SQLException e) { - e.printStackTrace(); - } catch (Exception e) { - e.printStackTrace(); - } - return rs; - } -} -``` - diff --git "a/content/docs-lite/zh/docs/Developerguide/\347\244\272\344\276\213-\345\270\270\347\224\250\346\223\215\344\275\234_JDBC.md" "b/content/docs-lite/zh/docs/Developerguide/\347\244\272\344\276\213-\345\270\270\347\224\250\346\223\215\344\275\234_JDBC.md" deleted file mode 100644 index 3c3c14f3b7e628c4d237323cb6b6ab5de4510e46..0000000000000000000000000000000000000000 --- "a/content/docs-lite/zh/docs/Developerguide/\347\244\272\344\276\213-\345\270\270\347\224\250\346\223\215\344\275\234_JDBC.md" +++ /dev/null @@ -1,272 +0,0 @@ -# 示例:常用操作 - -## 示例1 - -此示例将演示如何基于openGauss提供的JDBC接口开发应用程序。 - -``` -//DBtest.java -//演示基于JDBC开发的主要步骤,会涉及创建数据库、创建表、插入数据等。 - -import java.sql.Connection; -import java.sql.DriverManager; -import java.sql.PreparedStatement; -import java.sql.SQLException; -import java.sql.Statement; -import java.sql.CallableStatement; -import java.sql.Types; - -public class DBTest { - - //创建数据库连接。 - public static Connection GetConnection(String username, String passwd) { - String driver = "org.postgresql.Driver"; - String sourceURL = "jdbc:postgresql://localhost:8000/postgres"; - Connection conn = null; - try { - //加载数据库驱动。 - Class.forName(driver).newInstance(); - } catch (Exception e) { - e.printStackTrace(); - return null; - } - - try { - //创建数据库连接。 - conn = DriverManager.getConnection(sourceURL, username, passwd); - System.out.println("Connection succeed!"); - } catch (Exception e) { - e.printStackTrace(); - return null; - } - - return conn; - }; - - //执行普通SQL语句,创建customer_t1表。 - public static void CreateTable(Connection conn) { - Statement stmt = null; - try { - stmt = conn.createStatement(); - - //执行普通SQL语句。 - int rc = stmt - .executeUpdate("CREATE TABLE customer_t1(c_customer_sk INTEGER, c_customer_name VARCHAR(32));"); - - stmt.close(); - } catch (SQLException e) { - if (stmt != null) { - try { - stmt.close(); - } catch (SQLException e1) { - e1.printStackTrace(); - } - } - e.printStackTrace(); - } - } - - //执行预处理语句,批量插入数据。 - public static void BatchInsertData(Connection conn) { - PreparedStatement pst = null; - - try { - //生成预处理语句。 - pst = conn.prepareStatement("INSERT INTO customer_t1 VALUES (?,?)"); - for (int i = 0; i < 3; i++) { - //添加参数。 - pst.setInt(1, i); - pst.setString(2, "data " + i); - pst.addBatch(); - } - //执行批处理。 - pst.executeBatch(); - pst.close(); - } catch (SQLException e) { - if (pst != null) { - try { - pst.close(); - } catch (SQLException e1) { - e1.printStackTrace(); - } - } - e.printStackTrace(); - } - } - - //执行预编译语句,更新数据。 - public static void ExecPreparedSQL(Connection conn) { - PreparedStatement pstmt = null; - try { - pstmt = conn - .prepareStatement("UPDATE customer_t1 SET c_customer_name = ? WHERE c_customer_sk = 1"); - pstmt.setString(1, "new Data"); - int rowcount = pstmt.executeUpdate(); - pstmt.close(); - } catch (SQLException e) { - if (pstmt != null) { - try { - pstmt.close(); - } catch (SQLException e1) { - e1.printStackTrace(); - } - } - e.printStackTrace(); - } - } - - -//执行存储过程。 - public static void ExecCallableSQL(Connection conn) { - CallableStatement cstmt = null; - try { - // 存储过程TESTPROC需提前创建。 - cstmt=conn.prepareCall("{? = CALL TESTPROC(?,?,?)}"); - cstmt.setInt(2, 50); - cstmt.setInt(1, 20); - cstmt.setInt(3, 90); - cstmt.registerOutParameter(4, Types.INTEGER); //注册out类型的参数,类型为整型。 - cstmt.execute(); - int out = cstmt.getInt(4); //获取out参数 - System.out.println("The CallableStatment TESTPROC returns:"+out); - cstmt.close(); - } catch (SQLException e) { - if (cstmt != null) { - try { - cstmt.close(); - } catch (SQLException e1) { - e1.printStackTrace(); - } - } - e.printStackTrace(); - } - } - - - /** - * 主程序,逐步调用各静态方法。 - * @param args - */ - public static void main(String[] args) { - //创建数据库连接。 - Connection conn = GetConnection("tester", "Password1234"); - - //创建表。 - CreateTable(conn); - - //批插数据。 - BatchInsertData(conn); - - //执行预编译语句,更新数据。 - ExecPreparedSQL(conn); - - //执行存储过程。 - ExecCallableSQL(conn); - - //关闭数据库连接。 - try { - conn.close(); - } catch (SQLException e) { - e.printStackTrace(); - } - - } - -} -``` - -## 示例2客户端内存占用过多解决 - -此示例主要使用setFetchSize来调整客户端内存使用,它的原理是通过数据库游标来分批获取服务器端数据,但它会加大网络交互,可能会损失部分性能。 - -由于游标事务内有效,故需要先关闭自动提交,最后需要执行手动提交。 - -``` -// 关闭掉自动提交 -conn.setAutoCommit(false); -Statement st = conn.createStatement(); - -// 打开游标,每次获取50行数据 -st.setFetchSize(50); -ResultSet rs = st.executeQuery("SELECT * FROM mytable"); -while (rs.next()) -{ - System.out.print("a row was returned."); -} -conn.commit(); -rs.close(); - -// 关闭服务器游标。 -st.setFetchSize(0); -rs = st.executeQuery("SELECT * FROM mytable"); -while (rs.next()) -{ - System.out.print("many rows were returned."); -} -conn.commit(); -rs.close(); - -// Close the statement. -st.close(); -conn.close(); -``` - -执行完毕后可使用如下命令恢复自动提交: - -``` -conn.setAutoCommit(true); -``` - -## 示例3 常用数据类型使用示例 - -``` -//bit类型使用示例,注意此处bit类型取值范围[0,1] -Statement st = conn.createStatement(); -String sqlstr = "create or replace function fun_1()\n" + - "returns bit AS $$\n" + - "select col_bit from t_bit limit 1;\n" + - "$$\n" + - "LANGUAGE SQL;"; -st.execute(sqlstr); -CallableStatement c = conn.prepareCall("{ ? = call fun_1() }"); -//注册输出类型,位串类型 -c.registerOutParameter(1, Types.BIT); -c.execute(); -//使用Boolean类型获取结果 -System.out.println(c.getBoolean(1)); - -// money类型使用示例 -// 表结构中包含money类型列的使用示例。 -st.execute("create table t_money(col1 money)"); -PreparedStatement pstm = conn.prepareStatement("insert into t_money values(?)"); -// 使用PGobject赋值,取值范围[-92233720368547758.08,92233720368547758.07] -PGobject minMoney = new PGobject(); -minMoney.setType("money"); -minMoney.setValue("-92233720368547758.08"); -pstm.setObject(1, minMoney); -pstm.execute(); -// 使用PGMoney赋值,取值范围[-9999999.99,9999999.99] -pstm.setObject(1,new PGmoney(9999999.99)); -pstm.execute(); - -// 函数返回值为money的使用示例。 -st.execute("create or replace function func_money() " + - "return money " + - "as declare " + - "var1 money; " + - "begin " + - " select col1 into var1 from t_money limit 1; " + - " return var1; " + - "end;"); -CallableStatement cs = conn.prepareCall("{? = call func_money()}"); -cs.registerOutParameter(1,Types.DOUBLE); -cs.execute(); -cs.getObject(1); -``` - -## 示例4 获取驱动版本示例 - -``` -Driver.getGSVersion(); -``` - diff --git "a/content/docs-lite/zh/docs/Developerguide/\347\244\272\344\276\213-\345\270\270\347\224\250\346\223\215\344\275\234_Psycopg.md" "b/content/docs-lite/zh/docs/Developerguide/\347\244\272\344\276\213-\345\270\270\347\224\250\346\223\215\344\275\234_Psycopg.md" deleted file mode 100644 index e243aa0ec7ac4aacfe0169ae02f4bab792321cbc..0000000000000000000000000000000000000000 --- "a/content/docs-lite/zh/docs/Developerguide/\347\244\272\344\276\213-\345\270\270\347\224\250\346\223\215\344\275\234_Psycopg.md" +++ /dev/null @@ -1,57 +0,0 @@ -# 示例:常用操作 - -``` -import psycopg2 - -# psycopg2常用链接方式 -1. conn = psycopg2.connect(dbname="postgres", user="user", password="password", host="localhost", port=port) -2. conn = psycopg2.connect("dbname=postgres user=user password=password host=localhost port=port") - -# 创建连接对象 -conn=psycopg2.connect(database="postgres",user="user",password="password",host="localhost",port=port) -cur=conn.cursor() #创建指针对象 - -# 创建连接对象(SSl连接) -conn = psycopg2.connect(dbname="postgres", user="user", password="password", host="localhost", port=port, - sslmode="verify-ca", sslcert="client.crt",sslkey="client.key",sslrootcert="cacert.pem") -注意: 如果sslcert, sslkey,sslrootcert没有填写,默认取当前用户.postgresql目录下对应的client.crt, - client.key, root.crt - - -# 创建表 -cur.execute("CREATE TABLE student(id integer,name varchar,sex varchar);") - -# 插入数据 -cur.execute("INSERT INTO student(id,name,sex) VALUES(%s,%s,%s)",(1,'Aspirin','M')) -cur.execute("INSERT INTO student(id,name,sex) VALUES(%s,%s,%s)",(2,'Taxol','F')) -cur.execute("INSERT INTO student(id,name,sex) VALUES(%s,%s,%s)",(3,'Dixheral','M')) - -# 获取结果 -cur.execute('SELECT * FROM student') -results=cur.fetchall() -print (results) - -# 关闭连接 -conn.commit() -cur.close() -conn.close() - -# 使用日志 -import logging -import psycopg2 -from psycopg2.extras import LoggingConnection - -logging.basicConfig(level=logging.DEBUG) # 日志级别 -logger = logging.getLogger(__name__) - -db_settings = { - "user": "user", - "password": "password", - "host": "localhost", - "database": "postgres", - "port": port -} -conn = psycopg2.connect(connection_factory=LoggingConnection, **db_settings) -conn.initialize(logger) -``` - diff --git "a/content/docs-lite/zh/docs/Developerguide/\347\244\272\344\276\213-\351\200\232\350\277\207\346\234\254\345\234\260\346\226\207\344\273\266\345\257\274\345\205\245\345\257\274\345\207\272\346\225\260\346\215\256.md" "b/content/docs-lite/zh/docs/Developerguide/\347\244\272\344\276\213-\351\200\232\350\277\207\346\234\254\345\234\260\346\226\207\344\273\266\345\257\274\345\205\245\345\257\274\345\207\272\346\225\260\346\215\256.md" deleted file mode 100644 index 370168ef8257fd5bf0d691bba4951e8974becdc5..0000000000000000000000000000000000000000 --- "a/content/docs-lite/zh/docs/Developerguide/\347\244\272\344\276\213-\351\200\232\350\277\207\346\234\254\345\234\260\346\226\207\344\273\266\345\257\274\345\205\245\345\257\274\345\207\272\346\225\260\346\215\256.md" +++ /dev/null @@ -1,113 +0,0 @@ -# 示例:通过本地文件导入导出数据 - -在使用JAVA语言基于openGauss进行二次开发时,可以使用CopyManager接口,通过流方式,将数据库中的数据导出到本地文件或者将本地文件导入数据库中,文件格式支持CSV、TEXT等格式。 - -样例程序如下,执行时需要加载openGauss jdbc驱动。 - -``` -import java.sql.Connection; -import java.sql.DriverManager; -import java.io.IOException; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.sql.SQLException; -import org.postgresql.copy.CopyManager; -import org.postgresql.core.BaseConnection; - -public class Copy{ - - public static void main(String[] args) - { - String urls = new String("jdbc:postgresql://10.180.155.74:8000/postgres"); //数据库URL - String username = new String("jack"); //用户名 - String password = new String("xxxxxxxxx"); //密码 - String tablename = new String("migration_table"); //定义表信息 - String tablename1 = new String("migration_table_1"); //定义表信息 - String driver = "org.postgresql.Driver"; - Connection conn = null; - - try { - Class.forName(driver); - conn = DriverManager.getConnection(urls, username, password); - } catch (ClassNotFoundException e) { - e.printStackTrace(System.out); - } catch (SQLException e) { - e.printStackTrace(System.out); - } - - // 将SELECT * FROM migration_table查询结果导出到本地文件d:/data.txt - try { - copyToFile(conn, "d:/data.txt", "(SELECT * FROM migration_table)"); - } catch (SQLException e) { - k - e.printStackTrace(); - } catch (IOException e) { - - e.printStackTrace(); - } - //将d:/data.txt中的数据导入到migration_table_1中。 - try { - copyFromFile(conn, "d:/data.txt", tablename1); - } catch (SQLException e) { - e.printStackTrace(); - } catch (IOException e) { - - e.printStackTrace(); - } - - // 将migration_table_1中的数据导出到本地文件d:/data1.txt - try { - copyToFile(conn, "d:/data1.txt", tablename1); - } catch (SQLException e) { - - e.printStackTrace(); - } catch (IOException e) { - - - e.printStackTrace(); - } - } - // 使用copyIn把数据从文件中导入数据库, - public static void copyFromFile(Connection connection, String filePath, String tableName) - throws SQLException, IOException { - - FileInputStream fileInputStream = null; - - try { - CopyManager copyManager = new CopyManager((BaseConnection)connection); - fileInputStream = new FileInputStream(filePath); - copyManager.copyIn("COPY " + tableName + " FROM STDIN", fileInputStream); - } finally { - if (fileInputStream != null) { - try { - fileInputStream.close(); - } catch (IOException e) { - e.printStackTrace(); - } - } - } - } - - // 使用copyOut把数据从数据库中导出到文件中 - public static void copyToFile(Connection connection, String filePath, String tableOrQuery) - throws SQLException, IOException { - - FileOutputStream fileOutputStream = null; - - try { - CopyManager copyManager = new CopyManager((BaseConnection)connection); - fileOutputStream = new FileOutputStream(filePath); - copyManager.copyOut("COPY " + tableOrQuery + " TO STDOUT", fileOutputStream); - } finally { - if (fileOutputStream != null) { - try { - fileOutputStream.close(); - } catch (IOException e) { - e.printStackTrace(); - } - } - } - } -} -``` - diff --git "a/content/docs-lite/zh/docs/Developerguide/\347\244\272\344\276\213-\351\200\273\350\276\221\345\244\215\345\210\266\344\273\243\347\240\201\347\244\272\344\276\213.md" "b/content/docs-lite/zh/docs/Developerguide/\347\244\272\344\276\213-\351\200\273\350\276\221\345\244\215\345\210\266\344\273\243\347\240\201\347\244\272\344\276\213.md" deleted file mode 100644 index b67e0cbb02c8defa6fe7ebd6a13ca3cba6d259e9..0000000000000000000000000000000000000000 --- "a/content/docs-lite/zh/docs/Developerguide/\347\244\272\344\276\213-\351\200\273\350\276\221\345\244\215\345\210\266\344\273\243\347\240\201\347\244\272\344\276\213.md" +++ /dev/null @@ -1,181 +0,0 @@ -# 示例:逻辑复制代码示例 - -下面示例演示如何通过JDBC接口使用逻辑复制功能的过程。 - -针对逻辑复制的配置选项,除了在[逻辑解码](../DatabaseOMGuide/逻辑解码.md)中的配置选项外,还有专门给JDBC等流式解码工具增加的配置项,如下所示: - -1. 解码线程并行度 - - 通过配置选项parallel-decode-num,指定并行解码的Decoder线程数量。其取值范围为1\~20的int型,取1表示按照原有的串行逻辑进行解码,取其余值即为开启并行解码。默认值为1。当该选项配置为1时,禁止配置以下选项:解码格式选项decode-style、批量发送选项batch-sending和并行解码队列长度选项parallel-queue-size。 - -2. 解码格式 - - 通过配置选项decode-style,指定解码格式。其取值为char型的字符'j'、't'或'b',分别代表json格式、text格式及二进制格式。默认值为'b'即二进制格式解码。该选项仅允许并行解码时设置,且二进制格式解码仅在并行解码场景下支持。与二进制格式对应的json和text格式,在批量发送的解码结果中,每条解码语句的前4字节组成的uint32代表该条语句总字节数(不包含该uint32类型占用的4字节,0代表本批次解码结束),8字节uint64代表相应lsn(begin对应first\_lsn,commit对应end\_lsn,其他场景对应该条语句的lsn)。 - - ->![](public_sys-resources/icon-note.gif) **说明:** -> ->二进制格式编码规则如下所示: -> ->1. 前4字节代表接下来到语句级别分隔符字母P(不含)或者该批次结束符F(不含)的解码结果的总字节数,该值如果为0代表本批次解码结束。 ->2. 接下来8字节uint64代表相应lsn(begin对应first\_lsn,commit对应end\_lsn,其他场景对应该条语句的lsn)。 ->3. 接下来1字节的字母有5种B/C/I/U/D,分别代表begin/commit/insert/update/delete。 ->4. 第[3.接下来1字节的字母有5种B/C/I/U/D,...](#li12661162913519)步字母为B时: -> 1. 接下来的8字节uint64代表CSN。 -> 2. 接下来的8字节uint64代表first\_lsn。 -> 3. 【该部分为可选项】接下来的1字节字母如果为T,则代表后面4字节uint32表示该事务commit时间戳长度,再后面等同于该长度的字符为时间戳字符串。 -> 4. 因为之后仍可能有解码语句,接下来会有1字节字母P或F作为语句间的分隔符,P代表本批次仍有解码的语句,F代表本批次完成。 ->5. 第[3.接下来1字节的字母有5种B/C/I/U/D,...](#li12661162913519)步字母为C时: -> 1. 【该部分为可选项】接下来1字节字母如果为X,则代表后面的8字节uint64表示xid。 -> 2. 【该部分为可选项】接下来的1字节字母如果为T,则代表后面4字节uint32表示时间戳长度,再后面等同于该长度的字符为时间戳字符串。 -> 3. 因为批量发送日志时,一个COMMIT日志解码之后可能仍有其他事务的解码结果,接下来的1字节字母如果为P则表示该批次仍需解码,如果为F则表示该批次解码结束。 ->6. 第[3.接下来1字节的字母有5种B/C/I/U/D,...](#li12661162913519)步字母为I/U/D时: -> 1. 接下来的2字节uint16代表schema名的长度。 -> 2. 按照上述长度读取schema名。 -> 3. 接下来的2字节uint16代表table名的长度。 -> 4. 按照上述长度读取table名。 -> 5. 【该部分为可选项】接下来1字符字母如果为N代表为新元组,如果为O代表为旧元组,这里先发送新元组。 -> 1. 接下来的2字节uint16代表该元组需要解码的列数,记为attrnum。 -> 2. 以下流程重复attrnum次。 -> 1. 接下来2字节uint16代表列名的长度。 -> 2. 按照上述长度读取列名。 -> 3. 接下来4字节uint32代表当前列类型的Oid。 -> 4. 接下来4字节uint32代表当前列的值(以字符串格式存储)的长度,如果为0xFFFFFFFF则表示NULL,如果为0则表示长度为0的字符串。 -> 5. 按照上述长度读取列值。 -> 6. 因为之后仍可能有解码语句,接下来的1字节字母如果为P则表示该批次仍需解码,如果为F则表示该批次解码结束。 - -3. 限制仅备机解码 - - 通过配置选项standby-connection,指定是否限制仅备机解码。其取值为bool型(可用0或1表示),取true(或1)代表限制仅允许连接备机解码,连接主机解码时会报错退出;取false(或0)时不做限制。默认值为false(0)。 - -4. 批量发送 - - 通过配置选项sending-batch,指定是否批量发送。其取值范围为0或1的int型,取0表示逐条发送解码结果,取1表示解码结果累积到达1MB则批量发送解码结果。默认值为0。该选项仅允许并行解码时设置。开启批量发送的场景中,当解码格式为'j'或't'时,在原来的每条解码语句之前会附加一个uint32类型,表示本条解码结果长度(长度不包含当前的uint32类型),以及一个uint64类型,表示当前解码结果对应的lsn。 - -5. 并行解码队列长度 - - 通过配置选项parallel-queue-size,指定并行逻辑解码线程间进行交互的队列长度。取值范围【2,1024】,且必须为2的幂数,默认值为128。队列长度和解码过程的内存使用量正相关。 - -6. 逻辑解码内存阈值 - - 通过配置选项max-txn-in-memory指定单个事务解码中间结果缓存的内存阈值;单位为MB,范围【0,100】,默认值为0,表示不管控内存使用。通过配置选项max-reorderbuffer-in-memory指定所有事务解码中间结果缓存的内存阈值;单位为GB,范围【0,100】,默认值为0,表示不管控内存使用。当超过内存阈值时,解码过程将出现解码中间结果写临时文件的现象,影响逻辑解码的性能。 - -7. 逻辑解码发送超时阈值 - - 通过配置选项sender-timeout指定内核与客户端的心跳超时阈值。当该时间段内没有收到客户端任何消息,逻辑解码将主动停止,并断开和客户端的连接。单位为毫秒(ms),范围【0, 2147483647】,默认值取决于GUC参数logical\_sender\_timeout配置。 - -8. JDBC默认设置逻辑解码连接的socketTimeout=10s,备机解码在主机压力大的时候可能会导致连接超时关闭,可以通过配置withStatusInterval\(10000,TimeUnit.MILLISECONDS\),调整超时时间解决。 - - -在并行解码的标准场景下(16核CPU、内存128G、网络带宽 \> 200MBps、表的列数为10\~100、单行数据量0.1KB\~1KB、DML操作以insert为主、不涉及落盘事务即单个事务中语句数量小于4096、parallel-decode-num为8、解码格式为'b'且开启批量发送功能),解码性能(这里以xlog消耗量为标准)不低于100MBps。为保证解码性能达标以及尽量降低对业务的影响,一台备机上应尽量仅建立一个并行解码连接,保证CPU、内存、带宽资源充足。 - -注意:逻辑复制类PGReplicationStream为非线程安全类,并发调用可能导致数据异常。 - -``` -//逻辑复制功能示例:文件名,LogicalReplicationDemo.java -//前提条件:添加JDBC用户机器IP到数据库白名单里,在pg_hba.conf添加以下内容即可: -//假设JDBC用户IP为10.10.10.10 -//host all all 10.10.10.10/32 sha256 -//host replication all 10.10.10.10/32 sha256 - -import org.postgresql.PGProperty; -import org.postgresql.jdbc.PgConnection; -import org.postgresql.replication.LogSequenceNumber; -import org.postgresql.replication.PGReplicationStream; - -import java.nio.ByteBuffer; -import java.sql.DriverManager; -import java.util.Properties; -import java.util.concurrent.TimeUnit; - -public class LogicalReplicationDemo { - private static PgConnection conn = null; - public static void main(String[] args) { - String driver = "org.postgresql.Driver"; - //此处配置数据库IP以及端口,这里的端口为haPort,通常默认是所连接DN的port+1端口 - String sourceURL = "jdbc:postgresql://$ip:$port/postgres"; - //默认逻辑复制槽的名称是:replication_slot - //测试模式:创建逻辑复制槽 - int TEST_MODE_CREATE_SLOT = 1; - //测试模式:开启逻辑复制(前提条件是逻辑复制槽已经存在) - int TEST_MODE_START_REPL = 2; - //测试模式:删除逻辑复制槽 - int TEST_MODE_DROP_SLOT = 3; - //开启不同的测试模式 - int testMode = TEST_MODE_START_REPL; - - try { - Class.forName(driver); - } catch (Exception e) { - e.printStackTrace(); - return; - } - - try { - Properties properties = new Properties(); - PGProperty.USER.set(properties, "user"); - PGProperty.PASSWORD.set(properties, "passwd"); - //对于逻辑复制,以下三个属性是必须配置项 - PGProperty.ASSUME_MIN_SERVER_VERSION.set(properties, "9.4"); - PGProperty.REPLICATION.set(properties, "database"); - PGProperty.PREFER_QUERY_MODE.set(properties, "simple"); - conn = (PgConnection) DriverManager.getConnection(sourceURL, properties); - System.out.println("connection success!"); - - if(testMode == TEST_MODE_CREATE_SLOT){ - conn.getReplicationAPI() - .createReplicationSlot() - .logical() - .withSlotName("replication_slot") //这里字符串如包含大写字母则会自动转化为小写字母 - .withOutputPlugin("mppdb_decoding") - .make(); - }else if(testMode == TEST_MODE_START_REPL) { - //开启此模式前需要创建复制槽 - LogSequenceNumber waitLSN = LogSequenceNumber.valueOf("6F/E3C53568"); - PGReplicationStream stream = conn - .getReplicationAPI() - .replicationStream() - .logical() - .withSlotName("replication_slot") - .withSlotOption("include-xids", false) - .withSlotOption("skip-empty-xacts", true) - .withStartPosition(waitLSN) - .withSlotOption("parallel-decode-num", 10) //解码线程并行度 - .withSlotOption("white-table-list", "public.t1,public.t2") //白名单列表 - .withSlotOption("standby-connection", true) //强制备机解码 - .withSlotOption("decode-style", "t") //解码格式 - .withSlotOption("sending-batch", 1) //批量发送解码结果 - .withSlotOption("max-txn-in-memory", 100) //单个解码事务落盘内存阈值为100MB - .withSlotOption("max-reorderbuffer-in-memory", 50) //正在处理的解码事务落盘内存阈值为50GB - .start(); - while (true) { - ByteBuffer byteBuffer = stream.readPending(); - - if (byteBuffer == null) { - TimeUnit.MILLISECONDS.sleep(10L); - continue; - } - - int offset = byteBuffer.arrayOffset(); - byte[] source = byteBuffer.array(); - int length = source.length - offset; - System.out.println(new String(source, offset, length)); - - //如果需要flush lsn,根据业务实际情况调用以下接口 - //LogSequenceNumber lastRecv = stream.getLastReceiveLSN(); - //stream.setFlushedLSN(lastRecv); - //stream.forceUpdateStatus(); - - } - }else if(testMode == TEST_MODE_DROP_SLOT){ - conn.getReplicationAPI() - .dropReplicationSlot("replication_slot"); - } - } catch (Exception e) { - e.printStackTrace(); - return; - } - } -} -``` - diff --git "a/content/docs-lite/zh/docs/Developerguide/\347\244\272\344\276\213-\351\207\215\346\226\260\346\211\247\350\241\214\345\272\224\347\224\250SQL.md" "b/content/docs-lite/zh/docs/Developerguide/\347\244\272\344\276\213-\351\207\215\346\226\260\346\211\247\350\241\214\345\272\224\347\224\250SQL.md" deleted file mode 100644 index cc42267e8e8400687443b5e64a616780ac59cf0e..0000000000000000000000000000000000000000 --- "a/content/docs-lite/zh/docs/Developerguide/\347\244\272\344\276\213-\351\207\215\346\226\260\346\211\247\350\241\214\345\272\224\347\224\250SQL.md" +++ /dev/null @@ -1,199 +0,0 @@ -# 示例:重新执行应用SQL - -当主数据库节点故障且10s未恢复时,openGauss会将对应的备数据库节点升主,使openGauss正常运行。备升主期间正在运行的作业会失败;备升主后启动的作业不会再受影响。如果要做到数据库节点主备切换过程中,上层业务不感知,可参考此示例构建业务层SQL重试机制。 - -``` -import java.sql.Connection; -import java.sql.DriverManager; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; - -class ExitHandler extends Thread { - private Statement cancel_stmt = null; - - public ExitHandler(Statement stmt) { - super("Exit Handler"); - this.cancel_stmt = stmt; - } - public void run() { - System.out.println("exit handle"); - try { - this.cancel_stmt.cancel(); - } catch (SQLException e) { - System.out.println("cancel query failed."); - e.printStackTrace(); - } - } -} - -public class SQLRetry { - //创建数据库连接。 - public static Connection GetConnection(String username, String passwd) { - String driver = "org.postgresql.Driver"; - String sourceURL = "jdbc:postgresql://10.131.72.136:8000/postgres"; - Connection conn = null; - try { - //加载数据库驱动。 - Class.forName(driver).newInstance(); - } catch (Exception e) { - e.printStackTrace(); - return null; - } - - try { - //创建数据库连接。 - conn = DriverManager.getConnection(sourceURL, username, passwd); - System.out.println("Connection succeed!"); - } catch (Exception e) { - e.printStackTrace(); - return null; - } - - return conn; -} - - //执行普通SQL语句,创建jdbc_test1表。 - public static void CreateTable(Connection conn) { - Statement stmt = null; - try { - stmt = conn.createStatement(); - - - Runtime.getRuntime().addShutdownHook(new ExitHandler(stmt)); - - //执行普通SQL语句。 - int rc2 = stmt - .executeUpdate("DROP TABLE if exists jdbc_test1;"); - - int rc1 = stmt - .executeUpdate("CREATE TABLE jdbc_test1(col1 INTEGER, col2 VARCHAR(10));"); - - stmt.close(); - } catch (SQLException e) { - if (stmt != null) { - try { - stmt.close(); - } catch (SQLException e1) { - e1.printStackTrace(); - } - } - e.printStackTrace(); - } - } - - //执行预处理语句,批量插入数据。 - public static void BatchInsertData(Connection conn) { - PreparedStatement pst = null; - - try { - //生成预处理语句。 - pst = conn.prepareStatement("INSERT INTO jdbc_test1 VALUES (?,?)"); - for (int i = 0; i < 100; i++) { - //添加参数。 - pst.setInt(1, i); - pst.setString(2, "data " + i); - pst.addBatch(); - } - //执行批处理。 - pst.executeBatch(); - pst.close(); - } catch (SQLException e) { - if (pst != null) { - try { - pst.close(); - } catch (SQLException e1) { - e1.printStackTrace(); - } - } - e.printStackTrace(); - } - } - - //执行预编译语句,更新数据。 - private static boolean QueryRedo(Connection conn){ - PreparedStatement pstmt = null; - boolean retValue = false; - try { - pstmt = conn - .prepareStatement("SELECT col1 FROM jdbc_test1 WHERE col2 = ?"); - - pstmt.setString(1, "data 10"); - ResultSet rs = pstmt.executeQuery(); - - while (rs.next()) { - System.out.println("col1 = " + rs.getString("col1")); - } - rs.close(); - - pstmt.close(); - retValue = true; - } catch (SQLException e) { - System.out.println("catch...... retValue " + retValue); - if (pstmt != null) { - try { - pstmt.close(); - } catch (SQLException e1) { - e1.printStackTrace(); - } - } - e.printStackTrace(); - } - - System.out.println("finesh......"); - return retValue; - } - - //查询语句,执行失败重试,重试次数可配置。 - public static void ExecPreparedSQL(Connection conn) throws InterruptedException { - int maxRetryTime = 50; - int time = 0; - String result = null; - do { - time++; - try { - System.out.println("time:" + time); - boolean ret = QueryRedo(conn); - if(ret == false){ - System.out.println("retry, time:" + time); - Thread.sleep(10000); - QueryRedo(conn); - } - } catch (Exception e) { - e.printStackTrace(); - } - } while (null == result && time < maxRetryTime); - - } - - /** - * 主程序,逐步调用各静态方法。 - * @param args - * @throws InterruptedException - */ - public static void main(String[] args) throws InterruptedException { - //创建数据库连接。 - Connection conn = GetConnection("testuser", "test@123"); - - //创建表。 - CreateTable(conn); - - //批插数据。 - BatchInsertData(conn); - - //执行预编译语句,更新数据。 - ExecPreparedSQL(conn); - - //关闭数据库连接。 - try { - conn.close(); - } catch (SQLException e) { - e.printStackTrace(); - } - - } - - } -``` - diff --git "a/content/docs-lite/zh/docs/Developerguide/\347\250\213\345\272\217\345\274\200\345\217\221\350\247\204\350\214\203.md" "b/content/docs-lite/zh/docs/Developerguide/\347\250\213\345\272\217\345\274\200\345\217\221\350\247\204\350\214\203.md" deleted file mode 100644 index eaf9f01f0affd8a27a5a0841f977e9392f58bee7..0000000000000000000000000000000000000000 --- "a/content/docs-lite/zh/docs/Developerguide/\347\250\213\345\272\217\345\274\200\345\217\221\350\247\204\350\214\203.md" +++ /dev/null @@ -1 +0,0 @@ -# 程序开发规范 \ No newline at end of file diff --git "a/content/docs-lite/zh/docs/Developerguide/\347\272\246\346\235\237\350\256\276\350\256\241.md" "b/content/docs-lite/zh/docs/Developerguide/\347\272\246\346\235\237\350\256\276\350\256\241.md" deleted file mode 100644 index cb62848de267579ed6781167ef7327742bac3f75..0000000000000000000000000000000000000000 --- "a/content/docs-lite/zh/docs/Developerguide/\347\272\246\346\235\237\350\256\276\350\256\241.md" +++ /dev/null @@ -1,31 +0,0 @@ -# 约束设计 - -## DEFAULT和NULL约束 - -- 【建议】如果能够从业务层面补全字段值,那么,就不建议使用DEFAULT约束,避免数据加载时产生不符合预期的结果。 -- 【建议】给明确不存在NULL值的字段加上NOT NULL约束,优化器会在特定场景下对其进行自动优化。 -- 【建议】给可以显式命名的约束显式命名。除了NOT NULL和DEFAULT约束外,其他约束都可以显式命名。 - -## 局部聚簇 - -Partial Cluster Key(局部聚簇,简称PCK)是列存表的一种局部聚簇技术,在openGauss中,使用PCK可以通过min/max稀疏索引实现事实表快速过滤扫描。PCK的选取遵循以下原则: - -- 【关注】一张表上只能建立一个PCK,一个PCK可以包含多列,但是一般不建议超过2列。 -- 【建议】在查询中的简单表达式过滤条件上创建PCK。这种过滤条件一般形如col op const,其中col为列名,op为操作符=、\>、\>=、<=、<,const为常量值。 -- 【建议】在满足上面条件的前提下,选择distinct值比较多的列上建PCK。 - -## 唯一约束 - -- 【关注】行存表、列存表均支持唯一约束。 -- 【建议】从命名上明确标识唯一约束,例如,命名为“UNI+构成字段”。 - -## 主键约束 - -- 【关注】行存表、列存表均支持主键约束。 -- 【建议】从命名上明确标识主键约束,例如,将主键约束命名为“PK+字段名”。 - -## 检查约束 - -- 【关注】行存表支持检查约束,而列存表不支持。 -- 【建议】从命名上明确标识检查约束,例如,将检查约束命名为“CK+字段名”。 - diff --git "a/content/docs-lite/zh/docs/Developerguide/\347\274\226\350\257\221\344\270\216\350\260\203\350\257\225.md" "b/content/docs-lite/zh/docs/Developerguide/\347\274\226\350\257\221\344\270\216\350\260\203\350\257\225.md" deleted file mode 100644 index 6a33b5e244d4e3f0bc6910b892af6d4e8833d7d3..0000000000000000000000000000000000000000 --- "a/content/docs-lite/zh/docs/Developerguide/\347\274\226\350\257\221\344\270\216\350\260\203\350\257\225.md" +++ /dev/null @@ -1,160 +0,0 @@ -# 调试 - -用户可以根据自己的需要,通过修改实例数据目录下的postgresql.conf文件中特定的配置参数来控制日志的输出,从而更好地了解数据库的运行状态。 - -可调整的配置参数请参见[表1](#zh-cn_topic_0283136686_zh-cn_topic_0237120444_zh-cn_topic_0059779333_tec23904511dd4695b8b01f8c7c04563a)。 - -**表 1** 配置参数 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

参数名称

-

描述

-

取值范围

-

备注

-

client_min_messages

-

配置发送到客户端信息的级别。

-
  • DEBUG5
  • DEBUG4
  • DEBUG3
  • DEBUG2
  • DEBUG1
  • LOG
  • NOTICE
  • WARNING
  • ERROR
  • FATAL
  • PANIC
-

默认值:NOTICE 。

-

设置级别后,发送到客户端的信息包含所设级别及以下所有低级别会发送的信息。级别越低,发送的信息越少。

-

log_min_messages

-

配置写到服务器日志里信息的级别。

-
  • DEBUG5
  • DEBUG4
  • DEBUG3
  • DEBUG2
  • DEBUG1
  • INFO
  • NOTICE
  • WARNING
  • ERROR
  • LOG
  • FATAL
  • PANIC
-

默认值:WARNING。

-

指定某一级别后,写到日志的信息包含所有更高级别会输出的信息。级别越高,服务器日志的信息越少。

-

log_min_error_statement

-

配置写到服务器日志中错误SQL语句的级别。

-
  • DEBUG5
  • DEBUG4
  • DEBUG3
  • DEBUG2
  • DEBUG1
  • INFO
  • NOTICE
  • WARNING
  • ERROR
  • FATAL
  • PANIC
-

缺省值:ERROR。

-

所有导致一个特定级别(或者更高级别)错误的SQL语句都将记录在服务器日志中。

-

只有系统管理员可以修改该参数。

-

log_min_duration_statement

-

配置语句执行持续的最短时间。如果某个语句的持续时间大于或者等于设置的毫秒数,则会在日志中记录该语句及其持续时间。打开这个选项可以方便地跟踪需要优化的查询。

-

INT类型。

-

默认值:30min。

-

单位:毫秒。

-

设置为-1表示关闭这个功能。

-

只有系统管理员可以修改该参数。

-

log_connections/log_disconnections

-

配置是否在每次会话连接或结束时向服务器日志里打印一条信息。

-
  • on:每次会话连接或结束时向日志里打印一条信息。
  • off:每次会话连接或结束时不向日志里打印信息。
-

默认值:off。

-

-

-

log_duration

-

配置是否记录每个已完成语句的持续时间。

-
  • on:记录每个已完成语句的持续时间。
  • off:不记录已完成语句的持续时间。
-

默认值:off。

-

只有系统管理员可以修改该参数。

-

log_statement

-

配置日志中记录哪些SQL语句。

-
  • none:不记录任何SQL语句。
  • ddl:记录数据定义语句。
  • mod:记录数据定义语句和数据操作语句。
  • all :记录所有语句。
-

默认值: none。

-

只有系统管理员可以修改该参数。

-

log_hostname

-

配置是否记录主机名。

-
  • on:记录主机名。
  • off:不记录主机名。
-

默认值:off。

-

缺省时,连接日志只记录所连接主机的IP地址。打开这个选项会同时记录主机名。

-

该参数同时影响 查看审计结果GS_SESSION_MEMORY_DETAILPG_STAT_ACTIVITYlog_line_prefix参数。

-
- -上表有关参数级别的说明请参见[表2](#zh-cn_topic_0283136686_zh-cn_topic_0237120444_zh-cn_topic_0059779333_t3c729a4a94d145c7bdc4ca788236d8a7)。 - -**表 2** 日志级别参数说明 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

级别

-

说明

-

DEBUG[1-5]

-

提供开发人员使用的信息。5级为最高级别,依次类推,1级为最低级别。

-

INFO

-

提供用户隐含要求的信息。如在VACUUM VERBOSE过程中的信息。

-

NOTICE

-

提供可能对用户有用的信息。如长标识符的截断,作为主键一部分创建的索引。

-

WARNING

-

提供给用户的警告。如在事务块范围之外的COMMIT。

-

ERROR

-

报告导致当前命令退出的错误。

-

LOG

-

报告一些管理员感兴趣的信息。如检查点活跃性。

-

FATAL

-

报告导致当前会话终止的原因。

-

PANIC

-

报告导致所有会话退出的原因。

-
- diff --git "a/content/docs-lite/zh/docs/Developerguide/\350\241\250\350\256\276\350\256\241.md" "b/content/docs-lite/zh/docs/Developerguide/\350\241\250\350\256\276\350\256\241.md" deleted file mode 100644 index a7087a88a48c813a008a05d79284754fa8674371..0000000000000000000000000000000000000000 --- "a/content/docs-lite/zh/docs/Developerguide/\350\241\250\350\256\276\350\256\241.md" +++ /dev/null @@ -1,136 +0,0 @@ -# 表设计 - -总体上讲,良好的表设计需要遵循以下原则: - -- 【关注】减少需要扫描的数据量。通过分区表的剪枝机制可以大幅减少数据的扫描量。 -- 【关注】尽量减少随机I/O。通过聚簇/局部聚簇可以实现热数据的连续存储,将随机I/O转换为连续I/O,从而减少扫描的I/O代价。 - -## 选择存储方案 - -【建议】表的存储类型是表定义设计的第一步,客户业务类型是决定表的存储类型的主要因素,表存储类型的选择依据请参考[表1](#table3891877)。 - -**表 1** 表的存储类型及场景 - - - - - - - - - - - - - -

存储类型

-

适用场景

-

行存

-
  • 点查询(返回记录少,基于索引的简单查询)。
  • 增、删、改操作较多的场景。
-

列存

-
  • 统计分析类查询 (关联、分组操作较多的场景)。
  • 即席查询(查询条件不确定,行存表扫描难以使用索引)。
-
- -## 选择分区方案 - -当表中的数据量很大时,应当对表进行分区,一般需要遵循以下原则: - -- 【建议】使用具有明显区间性的字段进行分区,比如日期、区域等字段上建立分区。 -- 【建议】分区名称应当体现分区的数据特征。例如,关键字+区间特征。 -- 【建议】将分区上边界的分区值定义为MAXVALUE,以防止可能出现的数据溢出。 - - **表 2** 表的分区方式及使用场景 - - - - - - - - - - - - - - - - - - - -

分区方式

-

描述

-

Range

-

表数据通过范围进行分区。

-

Interval

-

表数据通过范围进行分区,超出范围的会自动根据间隔创建新的分区。

-

List

-

表数据通过指定列按照具体值进行分区。

-

Hash

-

表数据通过Hash散列方式进行分区。

-
- - 典型的分区表定义如下: - - ``` - --创建Range分区表 - CREATE TABLE staffS_p1 - ( - staff_ID NUMBER(6) not null, - FIRST_NAME VARCHAR2(20), - LAST_NAME VARCHAR2(25), - EMAIL VARCHAR2(25), - PHONE_NUMBER VARCHAR2(20), - HIRE_DATE DATE, - employment_ID VARCHAR2(10), - SALARY NUMBER(8,2), - COMMISSION_PCT NUMBER(4,2), - MANAGER_ID NUMBER(6), - section_ID NUMBER(4) - ) - PARTITION BY RANGE (HIRE_DATE) - ( - PARTITION HIRE_19950501 VALUES LESS THAN ('1995-05-01 00:00:00'), - PARTITION HIRE_19950502 VALUES LESS THAN ('1995-05-02 00:00:00'), - PARTITION HIRE_maxvalue VALUES LESS THAN (MAXVALUE) - ); - - --创建Interval分区表,初始两个分区,插入分区范围外的数据会自动新增分区 - CREATE TABLE sales - (prod_id NUMBER(6), - cust_id NUMBER, - time_id DATE, - channel_id CHAR(1), - promo_id NUMBER(6), - quantity_sold NUMBER(3), - amount_sold NUMBER(10,2) - ) - PARTITION BY RANGE (time_id) - INTERVAL('1 day') - ( PARTITION p1 VALUES LESS THAN ('2019-02-01 00:00:00'), - PARTITION p2 VALUES LESS THAN ('2019-02-02 00:00:00') - ); - - --创建List分区表 - CREATE TABLE test_list (col1 int, col2 int) - partition by list(col1) - ( - partition p1 values (2000), - partition p2 values (3000), - partition p3 values (4000), - partition p4 values (5000) - ); - - --创建Hash分区表 - CREATE TABLE test_hash (col1 int, col2 int) - partition by hash(col1) - ( - partition p1, - partition p2 - ); - ``` - - 更多的表分区语法信息参见[CREATE TABLE PARTITION](../SQLReference/CREATE-TABLE-PARTITION.md)。 - - diff --git "a/content/docs-lite/zh/docs/Developerguide/\350\247\204\345\210\222\345\255\230\345\202\250\346\250\241\345\236\213.md" "b/content/docs-lite/zh/docs/Developerguide/\350\247\204\345\210\222\345\255\230\345\202\250\346\250\241\345\236\213.md" deleted file mode 100644 index 4b35ad92ab7599dfbd1c3e5bb42229b8ea663c92..0000000000000000000000000000000000000000 --- "a/content/docs-lite/zh/docs/Developerguide/\350\247\204\345\210\222\345\255\230\345\202\250\346\250\241\345\236\213.md" +++ /dev/null @@ -1,119 +0,0 @@ -# 规划存储模型 - -openGauss支持行列混合存储。行、列存储模型各有优劣,建议根据实际情况选择。通常openGauss用于TP场景的数据库,默认使用行存储,仅对执行复杂查询且数据量大的AP场景时,才使用列存储。 - -行存储是指将表按行存储到硬盘分区上,列存储是指将表按列存储到硬盘分区上。默认情况下,创建的表为行存储。行存储和列存储的差异请参见[图1](#zh-cn_topic_0283136734_zh-cn_topic_0237120296_fig1417354233018)。 - -**图 1** 行存储和列存储的差异 - - -![](figures/zh-cn_image_0289900299.png) - -上图中,左上为行存表,右上为行存表在硬盘上的存储方式。左下为列存表,右下为列存表在硬盘上的存储方式。 - -行、列存储有如下优缺点: - - - - - - - - - - - - - - - - -

存储模型

-

优点

-

缺点

-

行存

-

数据被保存在一起。INSERT/UPDATE容易。

-

选择(Selection)时即使只涉及某几列,所有数据也都会被读取。

-

列存

-
  • 查询时只有涉及到的列会被读取。
  • 投影(Projection)很高效。
  • 任何列都能作为索引。
-
  • 选择完成时,被选择的列要重新组装。
  • INSERT/UPDATE比较麻烦。
-
- -一般情况下,如果表的字段比较多(大宽表),查询中涉及到的列不多的情况下,适合列存储。如果表的字段个数比较少,查询大部分字段,那么选择行存储比较好。 - - - - - - - - - - - - - -

存储类型

-

适用场景

-

行存

-
  • 点查询(返回记录少,基于索引的简单查询)。
  • 增、删、改操作较多的场景。
-

列存

-
  • 统计分析类查询 (关联、分组操作较多的场景)。
  • 即席查询(查询条件不确定,行存表扫描难以使用索引)。
-
- -## 行存表 - -默认创建表的类型。数据按行进行存储,即一行数据是连续存储。适用于对数据需要经常更新的场景。 - -``` -openGauss=# CREATE TABLE customer_t1 -( - state_ID CHAR(2), - state_NAME VARCHAR2(40), - area_ID NUMBER -); - ---删除表 -openGauss=# DROP TABLE customer_t1; -``` - -## 列存表 - -数据按列进行存储,即一列所有数据是连续存储的。单列查询IO小,比行存表占用更少的存储空间。适合数据批量插入、更新较少和以查询为主统计分析类的场景。列存表不适合点查询。 - -``` -openGauss=# CREATE TABLE customer_t2 -( - state_ID CHAR(2), - state_NAME VARCHAR2(40), - area_ID NUMBER -) -WITH (ORIENTATION = COLUMN); - ---删除表 -openGauss=# DROP TABLE customer_t2; -``` - -## 行存表和列存表的选择 - -- 更新频繁程度 - - 数据如果频繁更新,选择行存表。 - -- 插入频繁程度 - - 频繁的少量插入,选择行存表。一次插入大批量数据,选择列存表。 - -- 表的列数 - - 表的列数很多,选择列存表。 - -- 查询的列数 - - 如果每次查询时,只涉及了表的少数(<50%总列数)几个列,选择列存表。 - -- 压缩率 - - 列存表比行存表压缩率高。但高压缩率会消耗更多的CPU资源。 - - diff --git "a/content/docs-lite/zh/docs/Developerguide/\350\247\206\345\233\276\345\222\214\345\205\263\350\201\224\350\241\250\350\256\276\350\256\241.md" "b/content/docs-lite/zh/docs/Developerguide/\350\247\206\345\233\276\345\222\214\345\205\263\350\201\224\350\241\250\350\256\276\350\256\241.md" deleted file mode 100644 index dab0ba4a36b04520b0aaa7f140ba10a9fbfe3fe2..0000000000000000000000000000000000000000 --- "a/content/docs-lite/zh/docs/Developerguide/\350\247\206\345\233\276\345\222\214\345\205\263\350\201\224\350\241\250\350\256\276\350\256\241.md" +++ /dev/null @@ -1,13 +0,0 @@ -# 视图和关联表设计 - -## 视图设计 - -- 【建议】除非视图之间存在强依赖关系,否则不建议视图嵌套。 -- 【建议】视图定义中尽量避免排序操作。 - -## 关联表设计 - -- 【建议】表之间的关联字段应该尽量少。 -- 【建议】关联字段的数据类型应该保持一致。 -- 【建议】关联字段在命名上,应该可以明显体现出关联关系。例如,采用同样名称来命名。 - diff --git "a/content/docs-lite/zh/docs/Developerguide/\350\260\203\350\257\225.md" "b/content/docs-lite/zh/docs/Developerguide/\350\260\203\350\257\225.md" deleted file mode 100644 index 6a33b5e244d4e3f0bc6910b892af6d4e8833d7d3..0000000000000000000000000000000000000000 --- "a/content/docs-lite/zh/docs/Developerguide/\350\260\203\350\257\225.md" +++ /dev/null @@ -1,160 +0,0 @@ -# 调试 - -用户可以根据自己的需要,通过修改实例数据目录下的postgresql.conf文件中特定的配置参数来控制日志的输出,从而更好地了解数据库的运行状态。 - -可调整的配置参数请参见[表1](#zh-cn_topic_0283136686_zh-cn_topic_0237120444_zh-cn_topic_0059779333_tec23904511dd4695b8b01f8c7c04563a)。 - -**表 1** 配置参数 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

参数名称

-

描述

-

取值范围

-

备注

-

client_min_messages

-

配置发送到客户端信息的级别。

-
  • DEBUG5
  • DEBUG4
  • DEBUG3
  • DEBUG2
  • DEBUG1
  • LOG
  • NOTICE
  • WARNING
  • ERROR
  • FATAL
  • PANIC
-

默认值:NOTICE 。

-

设置级别后,发送到客户端的信息包含所设级别及以下所有低级别会发送的信息。级别越低,发送的信息越少。

-

log_min_messages

-

配置写到服务器日志里信息的级别。

-
  • DEBUG5
  • DEBUG4
  • DEBUG3
  • DEBUG2
  • DEBUG1
  • INFO
  • NOTICE
  • WARNING
  • ERROR
  • LOG
  • FATAL
  • PANIC
-

默认值:WARNING。

-

指定某一级别后,写到日志的信息包含所有更高级别会输出的信息。级别越高,服务器日志的信息越少。

-

log_min_error_statement

-

配置写到服务器日志中错误SQL语句的级别。

-
  • DEBUG5
  • DEBUG4
  • DEBUG3
  • DEBUG2
  • DEBUG1
  • INFO
  • NOTICE
  • WARNING
  • ERROR
  • FATAL
  • PANIC
-

缺省值:ERROR。

-

所有导致一个特定级别(或者更高级别)错误的SQL语句都将记录在服务器日志中。

-

只有系统管理员可以修改该参数。

-

log_min_duration_statement

-

配置语句执行持续的最短时间。如果某个语句的持续时间大于或者等于设置的毫秒数,则会在日志中记录该语句及其持续时间。打开这个选项可以方便地跟踪需要优化的查询。

-

INT类型。

-

默认值:30min。

-

单位:毫秒。

-

设置为-1表示关闭这个功能。

-

只有系统管理员可以修改该参数。

-

log_connections/log_disconnections

-

配置是否在每次会话连接或结束时向服务器日志里打印一条信息。

-
  • on:每次会话连接或结束时向日志里打印一条信息。
  • off:每次会话连接或结束时不向日志里打印信息。
-

默认值:off。

-

-

-

log_duration

-

配置是否记录每个已完成语句的持续时间。

-
  • on:记录每个已完成语句的持续时间。
  • off:不记录已完成语句的持续时间。
-

默认值:off。

-

只有系统管理员可以修改该参数。

-

log_statement

-

配置日志中记录哪些SQL语句。

-
  • none:不记录任何SQL语句。
  • ddl:记录数据定义语句。
  • mod:记录数据定义语句和数据操作语句。
  • all :记录所有语句。
-

默认值: none。

-

只有系统管理员可以修改该参数。

-

log_hostname

-

配置是否记录主机名。

-
  • on:记录主机名。
  • off:不记录主机名。
-

默认值:off。

-

缺省时,连接日志只记录所连接主机的IP地址。打开这个选项会同时记录主机名。

-

该参数同时影响 查看审计结果GS_SESSION_MEMORY_DETAILPG_STAT_ACTIVITYlog_line_prefix参数。

-
- -上表有关参数级别的说明请参见[表2](#zh-cn_topic_0283136686_zh-cn_topic_0237120444_zh-cn_topic_0059779333_t3c729a4a94d145c7bdc4ca788236d8a7)。 - -**表 2** 日志级别参数说明 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

级别

-

说明

-

DEBUG[1-5]

-

提供开发人员使用的信息。5级为最高级别,依次类推,1级为最低级别。

-

INFO

-

提供用户隐含要求的信息。如在VACUUM VERBOSE过程中的信息。

-

NOTICE

-

提供可能对用户有用的信息。如长标识符的截断,作为主键一部分创建的索引。

-

WARNING

-

提供给用户的警告。如在事务块范围之外的COMMIT。

-

ERROR

-

报告导致当前命令退出的错误。

-

LOG

-

报告一些管理员感兴趣的信息。如检查点活跃性。

-

FATAL

-

报告导致当前会话终止的原因。

-

PANIC

-

报告导致所有会话退出的原因。

-
- diff --git "a/content/docs-lite/zh/docs/Developerguide/\350\277\236\346\216\245\346\225\260\346\215\256\345\272\223_JDBC.md" "b/content/docs-lite/zh/docs/Developerguide/\350\277\236\346\216\245\346\225\260\346\215\256\345\272\223_JDBC.md" deleted file mode 100644 index 64fc0501f49f20a660c9d28e7bfc5c1b76669912..0000000000000000000000000000000000000000 --- "a/content/docs-lite/zh/docs/Developerguide/\350\277\236\346\216\245\346\225\260\346\215\256\345\272\223_JDBC.md" +++ /dev/null @@ -1,175 +0,0 @@ -# 连接数据库 - -在创建数据库连接之后,才能使用它来执行SQL语句操作数据。 - -## 函数原型 - -JDBC提供了三个方法,用于创建数据库连接。 - -- DriverManager.getConnection\(String url\); -- DriverManager.getConnection\(String url, Properties info\); -- DriverManager.getConnection\(String url, String user, String password\); - -## 参数 - -**表 1** 数据库连接参数 - - - - - - - - - - - - - - - - - - - -

参数

-

描述

-

url

-

以opengauss-jdbc-X.X.X.jar为例,opengauss-jdbc-X.X.X.jar的数据库连接描述符格式如下:

-
  • jdbc:postgresql:database
  • jdbc:postgresql://host/database
  • jdbc:postgresql://host:port/database
  • jdbc:postgresql://host:port/database?param1=value1&param2=value2
  • jdbc:postgresql://host1:port1,host2:port2/database?param1=value1&param2=value2
-
说明:
  • database为要连接的数据库名称。
  • host为数据库服务器名称或IP地址。

    由于安全原因,数据库主节点禁止openGauss内部其他节点无认证接入。如果要在openGauss内部访问数据库主节点,请将JDBC程序部署在数据库主节点所在机器,host使用“127.0.0.1”。否则可能会出现“FATAL: Forbid remote connection with trust method!”错误。

    -

    建议业务系统单独部署在openGauss外部,否则可能会影响数据库运行性能。

    -

    缺省情况下,连接服务器为localhost。

    -
  • port为数据库服务器端口。

    缺省情况下,会尝试连接到5432端口的database。

    -
  • param为参数名称,即数据库连接属性。

    参数可以配置在URL中,以“?”开始配置,以“=”给参数赋值,以“&”作为不同参数的间隔。也可以采用info对象的属性方式进行配置,详细示例会在本节给出。

    -
  • value为参数值,即数据库连接属性值。
  • 连接时需配置connectTimeout,socketTimeout,如果未配置,默认为0,即不会超时。在DN与客户端出现网络故障时,客户端一直未收到DN侧ACK确认报文,会启动超时重传机制,不断的进行重传。当超时时间达到系统默认的600s后才会报超时错误,这也就会导致RTO时间很高。
-
-

info

-

数据库连接属性(所有属性大小写敏感)。常用的属性如下:

-
  • PGDBNAME:String类型。表示数据库名称。(URL中无需配置该参数,自动从URL中解析)
  • PGHOST:String类型。主机IP地址。详细示例见下。
  • PGPORT:Integer类型。主机端口号。详细示例见下。
  • user:String类型。表示创建连接的数据库用户。
  • password:String类型。表示数据库用户的密码。
  • enable_ce: String类型。其中enable_ce=1表示JDBC支持密态等值查询。
    说明:

    轻量版场景下,openGauss不支持密态数据库。

    -
    -
  • refreshClientEncryption:String类型。其中refreshClientEncryption=1表示密态数据库支持客户端缓存刷新(默认值为1)。
    说明:

    轻量版场景下,openGauss不支持密态数据库。

    -
    -
  • loggerLevel:String类型。目前支持4种级别:OFF、INFO、DEBUG、TRACE。设置为OFF关闭日志,设置为INFO、DEBUG和TRACE记录的日志信息详细程度不同。默认值为INFO。该参数设置值不区分大小写。
  • loggerFile:String类型。Logger输出的文件名。需要显示指定日志文件名,若未指定目录则生成在客户端运行程序目录。
  • allowEncodingChanges:Boolean类型。设置该参数值为“true”进行字符集类型更改,配合characterEncoding=CHARSET设置字符集,二者使用“&”分隔;characterEncoding取值范围为UTF8、GBK、LATIN1。
  • currentSchema:String类型。在search-path中指定要设置的schema。
  • hostRecheckSeconds:Integer类型。JDBC尝试连接主机后会保存主机状态:连接成功或连接失败。在hostRecheckSeconds时间内保持可信,超过则状态失效。缺省值是10秒。
  • ssl:Boolean类型。以SSL方式连接。

    ssl=true可支持NonValidatingFactory通道和使用证书的方式:

    -

    1、NonValidatingFactory通道需要配置用户名和密码,同时将SSL设置为true。

    -

    2、配置客户端证书、密钥、根证书,将SSL设置为true。

    -
  • sslmode:String类型。SSL认证方式。取值范围为:disable、allow、prefer、require、verify-ca、verify-full。
    • disable:不使用SSL安全连接。
    • allow:如果数据库服务器要求使用,则可以使用SSL安全加密连接,但不验证数据库服务器的真实性。
    • prefer:如果数据库支持,那么首选使用SSL连接,但不验证数据库服务器的真实性。
    • require:只尝试SSL连接,如果存在CA文件,则应设置成verify-ca的方式验证。
    • verify-ca:只尝试SSL连接,并且验证服务器是否具有由可信任的证书机构签发的证书。
    • verify-full:只尝试SSL连接,并且验证服务器是否具有由可信任的证书机构签发的证书,以及验证服务器主机名是否与证书中的一致。
    -
  • sslcert:String类型。提供证书文件的完整路径。客户端和服务端证书的类型为End Entity。
  • sslkey:String类型。提供密钥文件的完整路径。使用时将客户端证书转换为DER格式:
    openssl pkcs8 -topk8 -outform DER -in client.key -out client.key.pk8 -nocrypt
    -
  • sslrootcert:String类型。SSL根证书的文件名。根证书的类型为CA。
  • sslpassword:String类型。提供给ConsoleCallbackHandler使用。
  • sslpasswordcallback:String类型。SSL密码提供者的类名。缺省值:org.postgresql.ssl.jdbc4.LibPQFactory.ConsoleCallbackHandler。
  • sslfactory:String类型。提供的值是SSLSocketFactory在建立SSL连接时用的类名。
  • sslfactoryarg:String类型。此值是上面提供的sslfactory类的构造函数的可选参数(不推荐使用)。
  • sslhostnameverifier:String类型。主机名验证程序的类名。接口实现javax.net.ssl.HostnameVerifier,默认使用org.postgresql.ssl.PGjdbcHostnameVerifier。
  • loginTimeout:Integer类型。指建立数据库连接的等待时间。超时时间单位为秒。当url配置多IP时,若获取连接花费的时间超过此值,则连接失败,不再尝试后续IP。
  • connectTimeout:Integer类型。用于连接服务器操作的超时值。如果连接到服务器花费的时间超过此值,则连接断开。超时时间单位为秒,值为0时表示已禁用,timeout不超时。当url配置多IP时,表示连接单个IP的超时时间。
  • socketTimeoutInConnecting:Integer类型。用于socket读取操作的超时值。在建立PgConnection到可以执行sql语句之前的socket读操作超时时间受该参数影响。如果从服务器读取所花费的时间超过此值,则连接关闭。超时时间单位为秒,值为0时表示已禁用,timeout不超时。默认值为5。
  • socketTimeout:Integer类型。用于socket读取操作的超时值。当连接可以执行sql语句之后,socket读操作超时时间受该参数影响。如果从服务器读取所花费的时间超过此值,则连接关闭。超时时间单位为秒,值为0时表示已禁用,timeout不超时。默认值为0。
  • cancelSignalTimeout:Integer类型。发送取消消息本身可能会阻塞,此属性控制用于取消命令的“connect超时”和“socket超时”。超时时间单位为秒,默认值为10秒。
  • tcpKeepAlive:Boolean类型。启用或禁用TCP保活探测功能。默认为false。
  • logUnclosedConnections:Boolean类型。客户端可能由于未调用Connection对象的close()方法而泄漏Connection对象。最终这些对象将被垃圾回收,并且调用finalize()方法。如果调用者自己忽略了此操作,该方法将关闭Connection。
  • assumeMinServerVersion:String类型。客户端会发送请求进行float精度设置。该参数设置要连接的服务器版本,如assumeMinServerVersion=9.0,可以在建立时减少相关包的发送。
  • ApplicationName:String类型。设置正在使用连接的JDBC驱动的名称。通过在数据库主节点上查询pg_stat_activity表可以看到正在连接的客户端信息,JDBC驱动名称显示在application_name列。缺省值为PostgreSQL JDBC Driver。
  • connectionExtraInfo:Boolean类型。表示驱动是否上报当前驱动的部署路径、进程属主用户到数据库。

    取值范围:true或false,默认值为false。设置connectionExtraInfo为true,JDBC驱动会将当前驱动的部署路径、进程属主用户、url连接配置信息上报到数据库中,记录在connection_info参数里;同时可以在PG_STAT_ACTIVITY中查询到。

    -
  • autosave:String类型。共有3种:"always", "never", "conservative"。如果查询失败,指定驱动程序应该执行的操作。在autosave=always模式下,JDBC驱动程序在每次查询之前设置一个保存点,并在失败时回滚到该保存点。在autosave=never模式(默认)下,无保存点。在autosave=conservative模式下,每次查询都会设置保存点,但是只会在“statement XXX无效”等情况下回滚并重试。
  • protocolVersion:Integer类型。连接协议版本号,目前仅支持1和3。注意:设置1时仅代表连接的是V1服务端。设置3时将采用md5加密方式,需要同步修改数据库的加密方式:gs_guc set -N all -I all -c "password_encryption_type=1" ,重启openGauss生效后需要创建用md5方式加密口令的用户。同时修改pg_hba.conf,将客户端连接方式修改为md5。用新建用户进行登录(不推荐)。
    说明:

    MD5加密算法安全性低,存在安全风险,建议使用更安全的加密算法。

    -
    -
  • prepareThreshold:Integer类型。控制parse语句何时发送。默认值是5。第一次parse一个SQL比较慢,后面再parse就会比较快,因为有缓存了。如果一个会话连续多次执行同一个SQL,在达到prepareThreshold次数以上时,JDBC将不再对这个SQL发送parse命令。
  • preparedStatementCacheQueries:Integer类型。确定每个连接中缓存的查询数,默认情况下是256。若在prepareStatement()调用中使用超过256个不同的查询,则最近最少使用的查询缓存将被丢弃。0表示禁用缓存。
  • preparedStatementCacheSizeMiB:Integer类型。确定每个连接可缓存的最大值(以兆字节为单位),默认情况下是5。若缓存了超过5MB的查询,则最近最少使用的查询缓存将被丢弃。0表示禁用缓存。
  • databaseMetadataCacheFields:Integer类型。默认值是65536。指定每个连接可缓存的最大值。“0”表示禁用缓存。
  • databaseMetadataCacheFieldsMiB:Integer类型。默认值是5。每个连接可缓存的最大值,单位是MB。“0”表示禁用缓存。
  • stringtype:String类型,可选字段为:false, "unspecified", "varchar"。设置通过setString()方法使用的PreparedStatement参数的类型,如果stringtype设置为VARCHAR(默认值),则这些参数将作为varchar参数发送给服务器。若stringtype设置为unspecified,则参数将作为untyped值发送到服务器,服务器将尝试推断适当的类型。
  • batchMode:Boolean类型。用于确定是否使用batch模式连接。默认值为on,表示开启batch模式。
  • fetchsize:Integer类型。用于设置数据库连接所创建statement的默认fetchsize。默认值为0,表示一次获取所有结果。与defaultRowFetchSize等价。
  • reWriteBatchedInserts:Boolean类型。批量导入时,该参数设置为true,可将N条插入语句合并为一条:insert into TABLE_NAME values(values1, ..., valuesN), ..., (values1, ..., valuesN);使用该参数时,需设置batchMode=off。
  • unknownLength:Integer类型,默认为Integer.MAX_VALUE。某些postgresql类型(例如TEXT)没有明确定义的长度,当通过ResultSetMetaData.getColumnDisplaySize和ResultSetMetaData.getPrecision等函数返回关于这些类型的数据时,此参数指定未知长度类型的长度。
  • defaultRowFetchSize:Integer类型。确定一次fetch在ResultSet中读取的行数。限制每次访问数据库时读取的行数可以避免不必要的内存消耗,从而避免OutOfMemoryException。缺省值是0,这意味着ResultSet中将一次获取所有行。没有负数。
  • binaryTransfer:Boolean类型。使用二进制格式发送和接收数据,默认值为“false”。
  • binaryTransferEnable:String类型。启用二进制传输的类型列表,以逗号分隔。OID编号和名称二选一,例如binaryTransferEnable=Integer4_ARRAY,Integer8_ARRAY。

    比如:OID名称为BLOB,编号为88,可以如下配置:

    -

    binaryTransferEnable=BLOB 或 binaryTransferEnable=88

    -
  • binaryTransferDisEnable:String类型。禁用二进制传输的类型列表,以逗号分隔。OID编号和名称二选一。覆盖binaryTransferEnable的设置。
  • blobMode:String类型。用于设置setBinaryStream方法为不同类型的数据赋值,设置为on时表示为blob类型数据赋值,设置为off时表示为bytea类型数据赋值,默认为on。
  • socketFactory:String类型。用于创建与服务器socket连接的类的名称。该类必须实现了接口“javax.net.SocketFactory”,并定义无参或单String参数的构造函数。
  • socketFactoryArg:String类型。此值是上面提供的socketFactory类的构造函数的可选参数,不推荐使用。
  • receiveBufferSize:Integer类型。该值用于设置连接流上的SO_RCVBUF。
  • sendBufferSize:Integer类型。该值用于设置连接流上的SO_SNDBUF。
  • preferQueryMode:String类型。共有4种:"extended", "extendedForPrepared", "extendedCacheEverything", "simple"。用于指定执行查询的模式,simple模式会excute,不parse和bind;extended模式会bind和excute;extendedForPrepared模式为prepared statement扩展使用;extendedCacheEverything模式会缓存每个statement。
  • -
  • targetServerType: String类型。该参数识别主备数据节点是通过查询URL连接串中,数据节点是否允许写操作来实现的,默认为"any"。共有四种:"any","master","slave","preferSlave":
    • master则尝试连接到URL连接串中的主节点,如果找不到就抛出异常。
    • slave则尝试连接到URL连接串中的备节点,如果找不到就抛出异常。
    • preferSlave则尝试连接到URL连接串中的备数据节点(如果有可用的话),否则连接到主数据节点。
    • any则尝试连接URL连接串中的任何一个数据节点。
    -
  • heartbeatPeriod:是否开启对集群主节点进行心跳维护。该功能主要针对连接主备集群并且配置连接主节点的场景,当主节点宕机后,jdbc会在其备机中查找新的主机,使下次建连的时候可以快速定位到新的主机。当且仅当设置了targetServerType=master且连接串的节点数大于1,如果可以建连成功,则开启或者加入对集群主节点的心跳维护,该参数配置小于等于0时,没有心跳间隔按照不开启,或者当前连接节点不加入心跳维护,Integer类型,默认值5000,单位毫秒
  • masterFailureHeartbeatTimeout:在开启主节点心跳维护的场景下,当集群主节点宕机,设置对集群探寻主节点的超时阈值,在这个超时时间内还没有探测到主节点的存在,则认为集群一直没有主节点,不在对当前集群进行维护,这个时间应该包含主节点的RTO时间,Integer类型,单位:毫秒,默认值:30000
  • priorityServers:Integer类型。此值用于指定url上配置的前n个节点作为主数据库实例被优先连接。默认值为null。该值为数字,大于0,且小于url上配置的DN数量。

    例如:jdbc:postgresql://host1:port1,host2:port2,host3:port3,host4:port4,/database?priorityServers=2。即表示host1与host2为主数据库实例节点,host3与host4为容灾数据库实例节点。

    -
  • forceTargetServerSlave:Boolean类型。此值用于控制是否开启强制连接备机功能,并在数据库实例发生主备切换时,禁止已存在的连接在升主备机上继续使用。默认值为false,表示不开启强制连接备机功能。true,表示开启强制连接备机功能。
  • traceInterfaceClass: String类型。默认值为null,用于获取traceId的实现类。值是实现获取traceId方法的接口org.postgresql.log.Tracer的实现类的完整限定类名。
  • loadBalanceHosts:Boolean类型。在默认模式下(禁用),默认顺序连接URL中指定的多个主机。如果启用,则使用洗牌算法从候选主机中随机选择一个主机建立连接。集中式环境下,如果使用此参数需要保证业务中没有写操作。
  • -
  • autoBalance:jdbc可以通过URL中设置多个数据库节点,实现对主备集群的访问。通过设置负载均衡算法,jdbc可以在建立连接时,依照特定规则将客户端与主备集群的连接依次建立在URL中配置的各个节点上,以此实现连接的负载均衡。默认值为"false",此时jdbc始终与URL中配置的同一个满足建连条件的节点建立连接。连接主备集群时,使用此参数需要保证业务中没有写操作,或者与targetServerType=slave搭配,限制客户端只连接备机。目前,jdbc提供了roundrobin、priority roundrobin、leastconn、shuffle四种负载均衡模式,具体说明如下: -
      -
    • roundrobin:轮询模式,即与各候选节点轮流建立连接。取值:"roundrobin"、"true"、"balance"。
    • -
    • priority roundrobin:带优先级的轮询模式,优先对前n个候选节点做轮询建连,取值:"proprity[n]",n为非负整数。
    • -
    • leastconn:最小连接模式,对候选节点依照各节点的有效连接数做优先级排序,优先与连接数少的节点建立连接,该方法只会统计通过当前驱动在当前集群内使用leastconn模式建立的连接。取值:"leastconn"。
    • -
    • shuffle:随机模式,即随机选择候选节点建立连接,取值:"shuffle"。loadBalanceHosts设置为"true"等同于autoBalance设置为"shuffle"。
    • -
    - 如果loadBalanceHosts设置为"true"的同时,autoBalance设置为以上四种负载均衡模式,优先使autoBalance生效;如果同时配置了autoBalance和targetServerType,jdbc会在满足targetServerType的前提下负载均衡;如果客户端使用多个指定了相同节点集合的URL分别通过同一驱动建立连接,jdbc会将其视为同一集群上的连接,并整体进行负载均衡。 -
  • -
  • enableQuickAutoBalance:是否开启集群状态变化时,jdbc快速负载均衡功能。该功能主要针对使用连接池连接主备集群并配置负载均衡的场景。当功能开启时,jdbc会定时检测URL中配置的节点的状态,当检测到节点恢复时,jdbc会筛选集群内其他节点上的空闲连接并关闭。连接池感知到缓存连接减少后,会基于leastconn模式在新恢复节点上创建连接,使集群重新负载均衡。该功能在筛选可关闭连接时,只会筛选由当前驱动创建的当前集群内的设置了enableQuickAutoBalance="true"的连接。该功能必须与最小连接模式配合使用:设置为"true"且autoBalance设置为"leastconn"时,功能开启。 -

    取值范围:{"true", "false"}。

    -

    默认值:"false"。

  • - -
  • maxIdleTimeBeforeTerminal:jdbc触发快速负载均衡时,可保留连接的最大空闲时长。jdbc快速负载均衡功能筛选空闲连接时,会将处于idle状态并且持续时间大于等于maxIdleTimeBeforeTerminal的连接视为空闲连接,这些连接可能会被关闭。该参数只在autoBalance设置为"leastconn"且enableQuickAutoBalance设置为"true"时才生效。 -

    单位:秒。

    -

    取值范围:[0, 9223372036854775)内的整数。

    -

    默认值: 30。

    -
  • -
  • minReservedConPerCluster:jdbc触发快速负载均衡时,一个集群内空闲连接的最小保留百分比。默认情况下,jdbc触发快速负载均衡时,所有被筛选出来的空闲连接都会被关闭。设置该参数可以在触发快速负载均衡时,jdbc会至少保留一个集群内空闲连接的minReservedConPerCluster%。该参数针对集群生效,如果存在多个配置了相同节点的URL都设置了该参数,则取最小值。 -

    取值范围:[0, 100]内的整数。

    -

    默认值:0。

    -
  • -
  • minReservedConPerDatanode:jdbc触发快速负载均衡时,一个节点内空闲连接的最小保留百分比。设置该参数可以在触发快速负载均衡时,jdbc会至少保留每个节点内空闲连接的minReservedConPerDatanode%。如果URL串同时设置了minReservedConPerDatanode和minReservedConPerCluster,jdbc会保证最终筛选出来的待关闭连接同时满足两个参数。该参数针对集群生效,如果存在多个配置了相同节点的URL都设置了该参数,则取最小值。 -

    取值范围:[0, 100]内的整数。

    -

    默认值:0。

    -
  • -
-

user

-

数据库用户。

-

password

-

数据库用户的密码。

-
- -## 示例 - -``` -//以下代码将获取数据库连接操作封装为一个接口,可通过给定用户名和密码来连接数据库。 -public static Connection getConnect(String username, String passwd) - { - //驱动类。 - String driver = "org.postgresql.Driver"; - //数据库连接描述符。 - String sourceURL = "jdbc:postgresql://10.10.0.13:8000/postgres"; - Connection conn = null; - - try - { - //加载驱动。 - Class.forName(driver); - } - catch( Exception e ) - { - e.printStackTrace(); - return null; - } - - try - { - //创建连接。 - conn = DriverManager.getConnection(sourceURL, username, passwd); - System.out.println("Connection succeed!"); - } - catch(Exception e) - { - e.printStackTrace(); - return null; - } - - return conn; - }; -// 以下代码将使用Properties对象作为参数建立连接 -public static Connection getConnectUseProp(String username, String passwd) - { - //驱动类。 - String driver = "org.postgresql.Driver"; - //数据库连接描述符。 - String sourceURL = "jdbc:postgresql://10.10.0.13:8000/postgres?"; - Connection conn = null; - Properties info = new Properties(); - - try - { - //加载驱动。 - Class.forName(driver); - } - catch( Exception e ) - { - e.printStackTrace(); - return null; - } - - try - { - info.setProperty("user", username); - info.setProperty("password", passwd); - //创建连接。 - conn = DriverManager.getConnection(sourceURL, info); - System.out.println("Connection succeed!"); - } - catch(Exception e) - { - e.printStackTrace(); - return null; - } - - return conn; - }; -``` - diff --git "a/content/docs-lite/zh/docs/Developerguide/\350\277\236\346\216\245\346\225\260\346\215\256\345\272\223_Psycopg.md" "b/content/docs-lite/zh/docs/Developerguide/\350\277\236\346\216\245\346\225\260\346\215\256\345\272\223_Psycopg.md" deleted file mode 100644 index a91f3176df55b6b12b6b9221d74923fcafdf0a7b..0000000000000000000000000000000000000000 --- "a/content/docs-lite/zh/docs/Developerguide/\350\277\236\346\216\245\346\225\260\346\215\256\345\272\223_Psycopg.md" +++ /dev/null @@ -1,5 +0,0 @@ -# 连接数据库 - -1. 使用psycopg2.connect函数获得connection对象。 -2. 使用connection对象创建cursor对象。 - diff --git "a/content/docs-lite/zh/docs/Developerguide/\350\277\236\346\216\245\346\225\260\346\215\256\345\272\223_SSL\346\226\271\345\274\217_Psycopg.md" "b/content/docs-lite/zh/docs/Developerguide/\350\277\236\346\216\245\346\225\260\346\215\256\345\272\223_SSL\346\226\271\345\274\217_Psycopg.md" deleted file mode 100644 index 00ce847629037fca6f1d6504fc8a8e8aec74b2b7..0000000000000000000000000000000000000000 --- "a/content/docs-lite/zh/docs/Developerguide/\350\277\236\346\216\245\346\225\260\346\215\256\345\272\223_SSL\346\226\271\345\274\217_Psycopg.md" +++ /dev/null @@ -1,70 +0,0 @@ -# 连接数据库(SSL方式) - -用户通过psycopy2连接openGauss服务器时,可以通过开启SSL加密客户端和服务器之间的通讯。在使用SSL时,默认用户已经获取了服务端和客户端所需要的证书和私钥文件,关于证书等文件的获取请参考Openssl相关文档和命令。 - -1. 使用\*.ini文件(python的configparser包可以解析这种类型的配置文件)保存数据库连接的配置信息。 -2. 在连接选项中添加SSL连接相关参数:sslmode,sslcert,sslkey,sslrootcert。 - 1. sslmode:可选项见[表1](#table167989176183)。 - 2. sslcert:客户端证书路径。 - 3. sslkey:客户端密钥路径。 - 4. sslrootcert:根证书路径。 - -3. 使用psycopg2.connect函数获得connection对象。 -4. 使用connection对象创建cursor对象。 - -**表 1** sslmode的可选项及其描述 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

sslmode

-

是否会启用SSL加密

-

描述

-

disable

-

-

不适用SSL安全连接。

-

allow

-

可能

-

如果数据库服务器要求使用,则可以使用SSL安全加密连接,但不验证数据库服务器的真实性。

-

prefer

-

可能

-

如果数据库支持,那么首选使用SSL连接,但不验证数据库服务器的真实性。

-

require

-

-

必须使用SSL安全连接,但是只做了数据加密,而并不验证数据库服务器的真实性。

-

verify-ca

-

-

必须使用SSL安全连接。

-

verify-full

-

-

必须使用SSL安全连接,目前openGauss暂不支持。

-
- diff --git "a/content/docs-lite/zh/docs/Developerguide/\350\277\236\346\216\245\346\225\260\346\215\256\345\272\223_UDS\346\226\271\345\274\217.md" "b/content/docs-lite/zh/docs/Developerguide/\350\277\236\346\216\245\346\225\260\346\215\256\345\272\223_UDS\346\226\271\345\274\217.md" deleted file mode 100644 index 0fccb469a3d03492498f6931c3dd34142ac6a8d4..0000000000000000000000000000000000000000 --- "a/content/docs-lite/zh/docs/Developerguide/\350\277\236\346\216\245\346\225\260\346\215\256\345\272\223_UDS\346\226\271\345\274\217.md" +++ /dev/null @@ -1,42 +0,0 @@ -# 连接数据库(UDS方式) - -Unix domain socket用于同一主机上不同进程间的数据交换,通过添加junixsocket获取套接字工厂使用。 - -需要引用的jar包有junixsocket-core-XXX.jar、junixsocket-common-XXX.jar、junixsocket-native-common-XXX.jar。同时需要在URL连接串中添加:socketFactory=org.newsclub.net.unix.AFUNIXSocketFactory$FactoryArg&socketFactoryArg=_\[path-to-the-unix-socket\]_。 - -示例: - -``` -import java.sql.Connection; -import java.sql.DriverManager; -import java.sql.Statement; -import java.util.Properties; - -public class Test { - public static void main(String[] args) { - String driver = "org.postgresql.Driver"; - Connection conn; - try { - Class.forName(driver).newInstance(); - Properties properties = new Properties(); - properties.setProperty("user", "username"); - properties.setProperty("password", "password"); - conn = DriverManager.getConnection("jdbc:postgresql://localhost:8000/postgres?socketFactory=org.newsclub" + - ".net.unix" + - ".AFUNIXSocketFactory$FactoryArg&socketFactoryArg=/data/tmp/.s.PGSQL.8000", - properties); - System.out.println("Connection Successful!"); - Statement statement = conn.createStatement(); - statement.executeQuery("select 1"); - } catch (Exception e) { - e.printStackTrace(); - } - } -} -``` - ->![](public_sys-resources/icon-notice.gif) **须知:** -> ->- socketFactoryArg参数配置根据真实路径进行配置,与GUC参数unix\_socket\_directory的值保持一致。 ->- 连接主机名必须设置为“localhost”。 - diff --git "a/content/docs-lite/zh/docs/Developerguide/\350\277\236\346\216\245\346\225\260\346\215\256\345\272\223_\344\273\245SSL\346\226\271\345\274\217.md" "b/content/docs-lite/zh/docs/Developerguide/\350\277\236\346\216\245\346\225\260\346\215\256\345\272\223_\344\273\245SSL\346\226\271\345\274\217.md" deleted file mode 100644 index 028377c56dc3f9ab66fd60406b6503e49ffa91f5..0000000000000000000000000000000000000000 --- "a/content/docs-lite/zh/docs/Developerguide/\350\277\236\346\216\245\346\225\260\346\215\256\345\272\223_\344\273\245SSL\346\226\271\345\274\217.md" +++ /dev/null @@ -1,134 +0,0 @@ -# 连接数据库(以SSL方式) - -用户通过JDBC连接openGauss服务器时,可以通过开启SSL加密客户端和服务器之间的通讯,为敏感数据在Internet上的传输提供了一种安全保障手段。本小节主要介绍应用程序通过JDBC如何采用SSL的方式连接openGauss。在使用本小节所描述的方法前,默认用户已经获取了服务端和客户端所需要的证书和私钥文件,关于证书等文件的获取请参考Openssl相关文档和命令。 - -## 服务端配置 - -当开启SSL模式后,必须提供根证书、服务器证书和私钥。 - -配置步骤(假设用户的证书文件放在数据目录/gaussdb/data/datanode下,且采用默认文件名): - -1. 以操作系统用户omm登录数据库主节点。 -2. 生成并配置证书。 - - 生成SSL证书,具体请参见[证书生成](../DatabaseAdministrationGuide/证书生成.md)。将生成出的文件server.crt,server.key,cacert.pem拷贝到服务端数据目录下。 - - 在Unix系统上,server.crt、server.key的权限设置必须禁止任何外部或组的访问,请执行如下命令实现这一点。 - - ``` - chmod 0600 server.key - ``` - -3. 开启SSL认证模式。 - - ``` - gs_guc set -D /gaussdb/data/datanode -c "ssl=on" - ``` - -4. 配置客户端接入认证参数,IP为所要连接的主机IP。 - - ``` - gs_guc reload -D /gaussdb/data/datanode -h "hostssl all all 127.0.0.1/32 cert" - gs_guc reload -D /gaussdb/data/datanode -h "hostssl all all IP/32 cert" - ``` - - 表示允许127.0.0.1/32网段的客户端以ssl认证方式连接到openGauss服务器。 - - >![](public_sys-resources/icon-notice.gif) **须知:** - > - >- 如果服务端pg\_hba.conf文件中METHOD配置为cert,则只有客户端使用证书(client.crt)中所设置的用户名(common name)才能够成功连接数据库。如果设置为md5、sm3或sha256则对连接数据库的用户没有限制。 - >- MD5加密算法安全性低,存在安全风险,建议使用更安全的加密算法。 - -5. 配置SSL认证相关的数字证书参数。 - - 各命令后所附为设置成功的回显。 - - ``` - gs_guc set -D /gaussdb/data/datanode -c "ssl_cert_file='server.crt'" - gs_guc set: ssl_cert_file='server.crt' - ``` - - ``` - gs_guc set -D /gaussdb/data/datanode -c "ssl_key_file='server.key'" - gs_guc set: ssl_key_file='server.key' - ``` - - ``` - gs_guc set -D /gaussdb/data/datanode -c "ssl_ca_file='cacert.pem'" - gs_guc set: ssl_ca_file='cacert.pem' - ``` - -6. 重启数据库。 - - ``` - gs_ctl restart -D /gaussdb/data/datanode - ``` - - -## 客户端配置 - -配置步骤如下: - -上传证书文件,将在服务端配置章节生成出的文件client.key.pk8,client.crt,cacert.pem放置在客户端。 - -## 示例 - -注:示例1和示例2选择其一。 - -``` -public class SSL{ - public static void main(String[] args) { - Properties urlProps = new Properties(); - String urls = "jdbc:postgresql://10.29.37.136:8000/postgres"; - - /** - * ================== 示例1 使用NonValidatingFactory通道 - */ - urlProps.setProperty("sslfactory","org.postgresql.ssl.NonValidatingFactory"); - urlProps.setProperty("user", "world"); - urlProps.setProperty("password", "test@123"); - urlProps.setProperty("ssl", "true"); - /** - * ================== 示例2 使用证书 - */ - urlProps.setProperty("sslcert", "client.crt"); - urlProps.setProperty("sslkey", "client.key.pk8"); - urlProps.setProperty("sslrootcert", "cacert.pem"); - urlProps.setProperty("user", "world"); - urlProps.setProperty("ssl", "true"); - /* sslmode可配置为:require、verify-ca、verify-full,以下三个示例选择其一*/ - /* ================== 示例2.1 设置sslmode为require,使用证书 */ - urlProps.setProperty("sslmode", "require"); - /* ================== 示例2.2 设置sslmode为verify-ca,使用证书 */ - urlProps.setProperty("sslmode", "verify-ca"); - /* ================== 示例2.3 设置sslmode为verify-full,使用证书(Linux下验证) */ - urls = "jdbc:postgresql://world:8000/postgres"; - urlProps.setProperty("sslmode", "verify-full"); - try { - Class.forName("org.postgresql.Driver").newInstance(); - } catch (Exception e) { - e.printStackTrace(); - } - try { - Connection conn; - conn = DriverManager.getConnection(urls,urlProps); - conn.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } -} -/** - * 注:将客户端密钥转化为DER格式: - * openssl pkcs8 -topk8 -outform DER -in client.key -out client.key.pk8 -nocrypt - * openssl pkcs8 -topk8 -inform PEM -in client.key -outform DER -out client.key.der -v1 PBE-MD5-DES - * openssl pkcs8 -topk8 -inform PEM -in client.key -outform DER -out client.key.der -v1 PBE-SHA1-3DES - * 以上算法由于安全级别较低,不推荐使用。 - * 如果客户需要采用更高级别的私钥加密算法,启用bouncycastle或者其他第三方私钥解密密码包后可以使用的私钥加密算法如下: - * openssl pkcs8 -in client.key -topk8 -outform DER -out client.key.der -v2 AES128 - * openssl pkcs8 -in client.key -topk8 -outform DER -out client.key.der -v2 aes-256-cbc -iter 1000000 - * openssl pkcs8 -in client.key -topk8 -out client.key.der -outform Der -v2 aes-256-cbc -v2prf hmacWithSHA512 - * 启用bouncycastle:使用jdbc的项目引入依赖:bcpkix-jdk15on.jar包,版本建议:1.65以上。 - */ -``` - diff --git "a/content/docs-lite/zh/docs/Developerguide/\351\223\276\346\216\245\345\217\202\346\225\260.md" "b/content/docs-lite/zh/docs/Developerguide/\351\223\276\346\216\245\345\217\202\346\225\260.md" deleted file mode 100644 index 038a8822aed582286fb5f93383a865f13612426b..0000000000000000000000000000000000000000 --- "a/content/docs-lite/zh/docs/Developerguide/\351\223\276\346\216\245\345\217\202\346\225\260.md" +++ /dev/null @@ -1,237 +0,0 @@ -# 链接参数 - -**表 1** 链接参数 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

参数

-

描述

-

host

-

要链接的主机名。如果主机名以斜杠开头,则它声明使用Unix域套接字通讯而不是TCP/IP通讯;该值就是套接字文件所存储的目录。如果没有声明host,那么默认是与位于/tmp目录(或者安装数据库的时候声明的套接字目录)里面的Unix-域套接字链接。在没有Unix域套接字的机器上,默认与localhost链接。

-

接受以‘,’分割的字符串来指定多个主机名,支持指定多个主机名。

-

hostaddr

-

与之链接的主机的IP地址,是标准的IPv4地址格式,比如,172.28.40.9。如果机器支持IPv6,那么也可以使用IPv6的地址。如果声明了一个非空的字符串,那么使用TCP/IP通讯机制。

-

接受以‘,’分割的字符串来指定多个IP地址,支持指定多个IP地址

-

使用hostaddr取代host可以让应用避免一次主机名查找,这一点对于那些有时间约束的应用来说可能是非常重要的。不过,GSSAPI或SSPI认证方法要求主机名(host)。因此,应用下面的规则:

-
  1. 如果声明了不带hostaddr的host那么就强制进行主机名查找。
  2. 如果声明中没有host,hostaddr的值给出服务器网络地址;如果认证方法要求主机名,那么链接尝试将失败。
  3. 如果同时声明了host和hostaddr,那么hostaddr的值作为服务器网络地址。host的值将被忽略,除非认证方法需要它,在这种情况下它将被用作主机名。
    须知:
    • 要注意如果host不是网络地址hostaddr处的服务器名,那么认证很有可能失败。
    • 如果主机名(host)和主机地址都没有,那么libpq将使用一个本地的Unix域套接字进行链接;或者是在没有Unix域套接字的机器上,它将尝试与localhost链接。
    -
    -
-

port

-

主机服务器的端口号,或者在Unix域套接字链接时的套接字扩展文件名。

-

接受以‘,’分割的字符串来指定多个端口号,支持指定多个端口号。

-

user

-

要链接的用户名,缺省是与运行该应用的用户操作系统名同名的用户。

-

dbname

-

数据库名,缺省和用户名相同。

-

password

-

如果服务器要求口令认证,所用的口令。

-

connect_timeout

-

链接的最大等待时间,以秒计(用十进制整数字符串书写),0或者不声明表示无穷。不建议把链接超时的值设置得小于2秒。

-

client_encoding

-

为这个链接设置client_encoding配置参数。除了对应的服务器选项接受的值,你可以使用auto从客户端中的当前环境中确定正确的编码(Unix系统上是LC_CTYPE环境变量)。

-

tty

-

忽略(以前,该参数指定了发送服务器调试输出的位置)。

-

options

-

添加命令行选项以在运行时发送到服务器。

-

application_name

-

为application_name配置参数指定一个值,表明当前用户身份。

-

fallback_application_name

-

application_name配置参数指定一个后补值。如果通过一个连接参数或PGAPPNAME环境变量没有为application_name给定一个值,将使用这个值。在希望设置一个默认应用名但不希望它被用户覆盖的一般工具程序中指定一个后补值很有用。

-

keepalives

-

控制客户端侧的TCP保持激活是否使用。缺省值是1,意思为打开,但是如果不想要保持激活,你可以更改为0,意思为关闭。通过Unix域套接字做的链接忽略这个参数。

-

keepalives_idle

-

在TCP应该发送一个保持激活的信息给服务器之后,控制不活动的秒数。0值表示使用系统缺省。通过Unix域套接字做的链接或者如果禁用了保持激活则忽略这个参数。

-

keepalives_interval

-

在TCP保持激活信息没有被应该传播的服务器承认之后,控制秒数。0值表示使用系统缺省。通过Unix域套接字做的链接或者如果禁用了保持激活则忽略这个参数。

-

keepalives_count

-

控制TCP发送保持激活信息的次数。0值表示使用系统缺省。通过Unix域套接字做的链接或者如果禁用了保持激活则忽略这个参数。

-

tcp_user_timeout

-

在支持TCP_USER_TIMEOUT套接字选项的操作系统上,指定传输的数据在TCP连接被强制关闭之前可以保持未确认状态的最大时长。0值表示使用系统缺省。通过Unix域套接字做的链接忽略这个参数。

-

rw_timeout

-

设置客户端连接读写超时时间。

-

sslmode

-

启用SSL加密的方式:

-
  • disable:不使用SSL安全连接。
  • allow:如果数据库服务器要求使用,则可以使用SSL安全加密连接,但不验证数据库服务器的真实性。
  • prefer:如果数据库支持,那么首选使用SSL安全加密连接,但不验证数据库服务器的真实性。
  • require:必须使用SSL安全连接,但是只做了数据加密,而并不验证数据库服务器的真实性。
  • verify-ca:必须使用SSL安全连接,当前windows odbc不支持cert方式认证。
  • verify-full:必须使用SSL安全连接,当前windows odbc不支持cert方式认证。
-

sslcompression

-

如果设置为1(默认),SSL连接之上传送的数据将被压缩(这要求OpenSSL版本为0.9.8或更高)。如果设置为0,压缩将被禁用(这要求OpenSSL版本为1.0.0或更高)。如果建立的是一个没有SSL的连接,这个参数会被忽略。如果使用的OpenSSL版本不支持该参数,它也会被忽略。压缩会占用CUP时间,但是当瓶颈为网络时可以提高吞吐量。如果CPU性能是限制因素,禁用压缩能够改进响应时间和吞吐量。

-

sslcert

-

这个参数指定客户端SSL证书的文件名,它替换默认的~/.postgresql/postgresql.crt。如果没有建立SSL连接,这个参数会被忽略。

-

sslkey

-

这个参数指定用于客户端证书的密钥位置。它能指定一个会被用来替代默认的~/.postgresql/postgresql.key的文件名,或者它能够指定一个从外部“引擎”(引擎是OpenSSL的可载入模块)得到的密钥。一个外部引擎说明应该由一个冒号分隔的引擎名称以及一个引擎相关的关键标识符组成。如果没有建立SSL连接,这个参数会被忽略。

-

sslrootcert

-

这个参数指定一个包含SSL证书机构(CA)证书的文件名称。如果该文件存在,服务器的证书将被验证是由这些机构之一签发。默认值是~/.postgresql/root.crt。

-

sslcrl

-

这个参数指定SSL证书撤销列表(CRL)的文件名。列在这个文件中的证书如果存在,在尝试认证该服务器证书时会被拒绝。默认值是~/.postgresql/root.crl。

-

requirepeer

-

这个参数指定服务器的操作系统用户,例如requirepeer=postgres。当建立一个Unix域套接字连接时,如果设置了这个参数,客户端在连接开始时检查服务器进程是否运行在指定的用户名之下。如果发现不是,该连接会被一个错误中断。这个参数能被用来提供与TCP/IP连接上SSL证书相似的服务器认证(注意,如果Unix域套接字在/tmp或另一个公共可写的位置,任何用户能启动一个在那里侦听的服务器。使用这个参数来保证你连接的是一个由可信用户运行的服务器)。这个选项只在实现了peer认证方法的平台上受支持。

-

krbsrvname

-

当用GSSAPI认证时,要使用的Kerberos服务名。为了让Kerberos认证成功,这必须匹配在服务器配置中指定的服务名。

-
说明:

轻量版场景下,openGauss不支持GSSAPI认证。

-
-

gsslib

-

用于GSSAPI认证的GSS库。只用在Windows上。设置为gssapi可强制libpq用GSSAPI库来代替默认的SSPI进行认证。

-
说明:

轻量版场景下,openGauss不支持GSSAPI认证。

-
-

service

-

用于附加参数的服务名。它指定保持附加连接参数的pg_service.conf中的一个服务名。这允许应用只指定一个服务名,这样连接参数能被集中维护。

-

authtype

-

不再使用“authtype”,因此将其标记为“不显示”。我们将其保留在数组中,以免拒绝旧应用程序中的conninfo字符串,这些应用程序可能仍在尝试设置它。

-

remote_nodename

-

指定连接本地节点的远端节点名称。

-

localhost

-

指定在一个连接通道中的本地地址。

-

localport

-

指定在一个连接通道中的本地端口。

-

fencedUdfRPCMode

-

控制fenced UDF RPC协议是使用unix域套接字或特殊套接字文件名。缺省值是0,意思为关闭,使用unix domain socket模式,文件类型为“.s.PGSQL.%d”,但是要使用fenced udf ,文件类型为.s.fencedMaster_unixdomain,可以更改为1,意思为开启。

-
说明:

轻量版场景下,openGauss不支持java udf功能。

-
-

replication

-

这个选项决定是否该连接应该使用复制协议而不是普通协议。这是PostgreSQL的复制连接以及pg_basebackup之类的工具在内部使用的协议,但也可以被第三方应用使用。支持下列值,大小写无关:

-
  • true、on、yes、1:连接进入到物理复制模式。
-
  • database:连接进入到逻辑复制模式,连接到dbname参数中指定的数据库。
-
  • false、off、no、0:该连接是一个常规连接,这是默认行为。
-

在物理或者逻辑复制模式中,仅能使用简单查询协议。

-

backend_version

-

传递到远端的后端版本号。

-

prototype

-

设置当前协议级别,默认:PROTO_TCP。

-

enable_ce

-

控制是否允许客户端连接全密态数据库。默认0,如果需要开启,则修改为1。

-
说明:

轻量版场景下,openGauss不支持密态数据库。

-
-

connection_info

-

Connection_info是一个包含driver_name、driver_version、driver_path和os_user的json字符串。

-

如果不为NULL,使用connection_info忽略connectionExtraInf

-

如果为NULL,生成与libpq相关的连接信息字符串,当connectionExtraInf为false时connection_info只有driver_name和driver_version。

-

connectionExtraInf

-

设置connection_info是否存在扩展信息,默认值为0,如果包含其他信息,则需要设置为1。

-

target_session_attrs

-

设定连接的主机的类型。主机的类型和设定的值一致时才能连接成功。target_session_attrs的设置规则如下:

-
  • any(默认值): 可以对所有类型的主机进行连接。
  • read-write:当连接的主机允许可读可写时,才进行连接。
  • read-only:仅对可读的主机进行连接。
  • primary:仅对主备系统中的主机能进行连接。
  • standby: 仅对主备系统中的备机进行连接。
  • prefer-standby:首先尝试找到一个备机进行连接。如果对hosts列表的所有机器都连接失败,那么尝试“any”模式进行连接。
-
-