diff --git "a/content/docs-lite/zh/docs/ExtensionReference/shark-\345\207\275\346\225\260\345\222\214\346\223\215\344\275\234\347\254\246.md" "b/content/docs-lite/zh/docs/ExtensionReference/shark-\345\207\275\346\225\260\345\222\214\346\223\215\344\275\234\347\254\246.md"
index e1ba84ab5492023f09bde25e146dd14cbf231a0e..663054b2c17c75ad10665bf736478095cc8c0e3c 100644
--- "a/content/docs-lite/zh/docs/ExtensionReference/shark-\345\207\275\346\225\260\345\222\214\346\223\215\344\275\234\347\254\246.md"
+++ "b/content/docs-lite/zh/docs/ExtensionReference/shark-\345\207\275\346\225\260\345\222\214\346\223\215\344\275\234\347\254\246.md"
@@ -1,3 +1,5 @@
# shark-函数和操作符
- **[系统信息函数](shark-系统信息函数.md)**
+
+- **[系统信息函数](shark-常用函数.md)**
diff --git "a/content/docs-lite/zh/docs/ExtensionReference/shark-\345\270\270\347\224\250\345\207\275\346\225\260.md" "b/content/docs-lite/zh/docs/ExtensionReference/shark-\345\270\270\347\224\250\345\207\275\346\225\260.md"
new file mode 100644
index 0000000000000000000000000000000000000000..349667e2f8580b5e6405ef73c16fbc7d6c53ab94
--- /dev/null
+++ "b/content/docs-lite/zh/docs/ExtensionReference/shark-\345\270\270\347\224\250\345\207\275\346\225\260.md"
@@ -0,0 +1,51 @@
+# shark-常用函数
+
+本章节只包含shark插件新增的常用函数。
+
+- rand()
+
+ 描述:0.0到1.0之间的随机数。等价于random。
+
+ 返回值类型:double precision
+
+ 示例:
+
+ ```
+ openGauss=# SELECT rand();
+ rand
+ -------------------
+ 0.254671605769545
+ (1 row)
+ ```
+
+- rand(seed int)
+
+ 描述:根据入参设置随机数种子,随后生成0.0到1.0之间的随机数。等价于setseed+random。种子的有效值范围为 [-2^63, 2^64 - 1]。
+
+ 返回值类型:double precision
+
+ 示例:
+
+ ```
+ openGauss=# SELECT rand(1);
+ rand
+ -------------------
+ 0.0416303444653749
+ (1 row)
+ ```
+
+- day(timestamp)
+
+ 描述:获取日期/时间值中天数的值。
+
+ 返回值类型:double precision
+
+ 示例:
+
+ ```
+ openGauss=# SELECT day(timestamp '2001-02-16 20:38:40');
+ day
+ -----------
+ 16
+ (1 row)
+ ```
diff --git "a/content/docs-lite/zh/docs/ExtensionReference/shark-\347\263\273\347\273\237\344\277\241\346\201\257\345\207\275\346\225\260.md" "b/content/docs-lite/zh/docs/ExtensionReference/shark-\347\263\273\347\273\237\344\277\241\346\201\257\345\207\275\346\225\260.md"
index d8801f6cfe7fc2dfecce28e61ba207cb12270e2b..9f70c07e8f7f2420526607a403dbff4816198c21 100644
--- "a/content/docs-lite/zh/docs/ExtensionReference/shark-\347\263\273\347\273\237\344\277\241\346\201\257\345\207\275\346\225\260.md"
+++ "b/content/docs-lite/zh/docs/ExtensionReference/shark-\347\263\273\347\273\237\344\277\241\346\201\257\345\207\275\346\225\260.md"
@@ -51,3 +51,254 @@
```
select @@SPID;
```
+
+## 对象信息函数
+
+- object_id('[database_name.[schema_name]. | schema_name.]object_name' [, 'object_type'])
+
+ 描述:返回数据库对象的oid。如果没有查询权限或者对象不存在则返回NULL。
+
+ 第二个参数object_type支持以下类型
+
+
+
+ 属性名称 |
+ 说明 |
+
+
+
+
+ S |
+ 系统表 |
+
+
+ U |
+ 用户表 |
+
+
+ V |
+ 视图 |
+
+
+ SO |
+ 序列 |
+
+
+ C |
+ check约束 |
+
+
+ D |
+ DEAULTA约束 |
+
+
+ F |
+ FOREIGN KEY约束 |
+
+
+ PK |
+ 主键约束 |
+
+
+ UQ |
+ UNIQUE约束 |
+
+
+ AF |
+ 聚合函数 |
+
+
+ FN |
+ 函数 |
+
+
+ P |
+ 存储过程 |
+
+
+ TR |
+ 触发器 |
+
+
+
+
+ 返回值类型:int
+
+ 示例:
+
+ ```
+ CREATE TABLE sys.students (
+ id SERIAL PRIMARY KEY,
+ name VARCHAR(100) NOT NULL,
+ age INT DEFAULT 0,
+ grade DECIMAL(5, 2)
+ );
+ set search_path = 'sys';
+ select object_id('students');
+ object_id
+ -----------
+ 16666
+ (1 row)
+
+ select object_id('sys.students', 'U');
+ object_id
+ -----------
+ 16666
+ (1 row)
+ ```
+
+
+- objectproperty(oid, property)
+
+ 描述:返回插件框架中对象的对应属性结果。对象类型不符合返回NULL。
+
+ property可选范围
+
+ 返回值类型:int
+
+ **表1** property属性表
+
+
+
+
+ 属性名称 |
+ 对象类型 |
+ 说明 |
+
+
+
+
+ IsDefault |
+ 任何对象 |
+ 返回0。 |
+
+
+ IsDefaultCnst |
+ 任何对象 |
+ 是否为DEFAULT约束。1=True, 0=False |
+
+
+ IsDeterministic |
+ 函数 |
+ 返回0。 |
+
+
+ IsIndexed |
+ 表、视图 |
+ 有索引的表或视图。1=True, 0=False |
+
+
+ IsInlineFunction |
+ 函数 |
+ 内联函数。1=True, 0=False |
+
+
+ IsSysShipped |
+ 任何对象 |
+ sys框架下的对象。1=True, 0=False |
+
+
+ IsPrimaryKey |
+ 任何对象 |
+ 是否为PRIMARY KEY约束。1=True, 0=False |
+
+
+ IsProcedure |
+ 任何对象 |
+ 是否为存储过程。1=True, 0=False |
+
+
+ IsRule |
+ 任何对象 |
+ 返回0。 |
+
+
+ IsScalarFunction |
+ 函数 |
+ 是否为标量值函数。1=True, 0=False |
+
+
+ IsSchemaBound |
+ 函数、视图 |
+ 返回0。 |
+
+
+ IsTable |
+ 表 |
+ 是否为表。1=True, 0=False |
+
+
+ IsTableFunction |
+ 函数 |
+ 是否为表值函数。1=True, 0=False |
+
+
+ IsTrigger |
+ 任何对象 |
+ 是否为触发器。1=True, 0=False |
+
+
+ IsUserTable |
+ 表 |
+ 是否为用户表。1=True, 0=False |
+
+
+ IsView |
+ 视图 |
+ 是否为视图。1=True, 0=False |
+
+
+ OwnerId |
+ 任何对象 |
+ 返回对象所有者的oid。 |
+
+
+ ExeclsQuotedIdentOn |
+ 函数、存储过程、触发器、视图 |
+ 返回1。 |
+
+
+ ExeclsIsAnsiNullsOn |
+ 函数、存储过程、触发器、视图 |
+ 返回1。 |
+
+
+ TableFulltextPopulateStatus |
+ 表 |
+ 返回0。 |
+
+
+ TableHasVarDecimalStorageFormat |
+ 表 |
+ 返回0。 |
+
+
+
+
+ 示例:
+ 其中database为当前数据库
+
+ ```
+ CREATE TABLE sys.students (
+ id SERIAL PRIMARY KEY,
+ name VARCHAR(100) NOT NULL,
+ age INT DEFAULT 0,
+ grade DECIMAL(5, 2)
+ );
+ set search_path = 'sys';
+ select objectproperty(object_id('students'), 'ownerid') as ownerid;
+ ownerid
+ ---------
+ 10
+ (1 row)
+ select objectproperty(object_id('sys.students'), 'istable') as ownerid;
+ ownerid
+ ---------
+ 1
+ (1 row)
+ select objectproperty(object_id('database.sys.students'), 'isview') as ownerid;
+ ownerid
+ ---------
+ 0
+ (1 row)
+ ```
\ No newline at end of file
diff --git "a/content/zh/docs/ExtensionReference/shark-\345\207\275\346\225\260\345\222\214\346\223\215\344\275\234\347\254\246.md" "b/content/zh/docs/ExtensionReference/shark-\345\207\275\346\225\260\345\222\214\346\223\215\344\275\234\347\254\246.md"
index e1ba84ab5492023f09bde25e146dd14cbf231a0e..663054b2c17c75ad10665bf736478095cc8c0e3c 100644
--- "a/content/zh/docs/ExtensionReference/shark-\345\207\275\346\225\260\345\222\214\346\223\215\344\275\234\347\254\246.md"
+++ "b/content/zh/docs/ExtensionReference/shark-\345\207\275\346\225\260\345\222\214\346\223\215\344\275\234\347\254\246.md"
@@ -1,3 +1,5 @@
# shark-函数和操作符
- **[系统信息函数](shark-系统信息函数.md)**
+
+- **[系统信息函数](shark-常用函数.md)**
diff --git "a/content/zh/docs/ExtensionReference/shark-\345\270\270\347\224\250\345\207\275\346\225\260.md" "b/content/zh/docs/ExtensionReference/shark-\345\270\270\347\224\250\345\207\275\346\225\260.md"
new file mode 100644
index 0000000000000000000000000000000000000000..349667e2f8580b5e6405ef73c16fbc7d6c53ab94
--- /dev/null
+++ "b/content/zh/docs/ExtensionReference/shark-\345\270\270\347\224\250\345\207\275\346\225\260.md"
@@ -0,0 +1,51 @@
+# shark-常用函数
+
+本章节只包含shark插件新增的常用函数。
+
+- rand()
+
+ 描述:0.0到1.0之间的随机数。等价于random。
+
+ 返回值类型:double precision
+
+ 示例:
+
+ ```
+ openGauss=# SELECT rand();
+ rand
+ -------------------
+ 0.254671605769545
+ (1 row)
+ ```
+
+- rand(seed int)
+
+ 描述:根据入参设置随机数种子,随后生成0.0到1.0之间的随机数。等价于setseed+random。种子的有效值范围为 [-2^63, 2^64 - 1]。
+
+ 返回值类型:double precision
+
+ 示例:
+
+ ```
+ openGauss=# SELECT rand(1);
+ rand
+ -------------------
+ 0.0416303444653749
+ (1 row)
+ ```
+
+- day(timestamp)
+
+ 描述:获取日期/时间值中天数的值。
+
+ 返回值类型:double precision
+
+ 示例:
+
+ ```
+ openGauss=# SELECT day(timestamp '2001-02-16 20:38:40');
+ day
+ -----------
+ 16
+ (1 row)
+ ```
diff --git "a/content/zh/docs/ExtensionReference/shark-\347\263\273\347\273\237\344\277\241\346\201\257\345\207\275\346\225\260.md" "b/content/zh/docs/ExtensionReference/shark-\347\263\273\347\273\237\344\277\241\346\201\257\345\207\275\346\225\260.md"
index d8801f6cfe7fc2dfecce28e61ba207cb12270e2b..9f70c07e8f7f2420526607a403dbff4816198c21 100644
--- "a/content/zh/docs/ExtensionReference/shark-\347\263\273\347\273\237\344\277\241\346\201\257\345\207\275\346\225\260.md"
+++ "b/content/zh/docs/ExtensionReference/shark-\347\263\273\347\273\237\344\277\241\346\201\257\345\207\275\346\225\260.md"
@@ -51,3 +51,254 @@
```
select @@SPID;
```
+
+## 对象信息函数
+
+- object_id('[database_name.[schema_name]. | schema_name.]object_name' [, 'object_type'])
+
+ 描述:返回数据库对象的oid。如果没有查询权限或者对象不存在则返回NULL。
+
+ 第二个参数object_type支持以下类型
+
+
+
+ 属性名称 |
+ 说明 |
+
+
+
+
+ S |
+ 系统表 |
+
+
+ U |
+ 用户表 |
+
+
+ V |
+ 视图 |
+
+
+ SO |
+ 序列 |
+
+
+ C |
+ check约束 |
+
+
+ D |
+ DEAULTA约束 |
+
+
+ F |
+ FOREIGN KEY约束 |
+
+
+ PK |
+ 主键约束 |
+
+
+ UQ |
+ UNIQUE约束 |
+
+
+ AF |
+ 聚合函数 |
+
+
+ FN |
+ 函数 |
+
+
+ P |
+ 存储过程 |
+
+
+ TR |
+ 触发器 |
+
+
+
+
+ 返回值类型:int
+
+ 示例:
+
+ ```
+ CREATE TABLE sys.students (
+ id SERIAL PRIMARY KEY,
+ name VARCHAR(100) NOT NULL,
+ age INT DEFAULT 0,
+ grade DECIMAL(5, 2)
+ );
+ set search_path = 'sys';
+ select object_id('students');
+ object_id
+ -----------
+ 16666
+ (1 row)
+
+ select object_id('sys.students', 'U');
+ object_id
+ -----------
+ 16666
+ (1 row)
+ ```
+
+
+- objectproperty(oid, property)
+
+ 描述:返回插件框架中对象的对应属性结果。对象类型不符合返回NULL。
+
+ property可选范围
+
+ 返回值类型:int
+
+ **表1** property属性表
+
+
+
+
+ 属性名称 |
+ 对象类型 |
+ 说明 |
+
+
+
+
+ IsDefault |
+ 任何对象 |
+ 返回0。 |
+
+
+ IsDefaultCnst |
+ 任何对象 |
+ 是否为DEFAULT约束。1=True, 0=False |
+
+
+ IsDeterministic |
+ 函数 |
+ 返回0。 |
+
+
+ IsIndexed |
+ 表、视图 |
+ 有索引的表或视图。1=True, 0=False |
+
+
+ IsInlineFunction |
+ 函数 |
+ 内联函数。1=True, 0=False |
+
+
+ IsSysShipped |
+ 任何对象 |
+ sys框架下的对象。1=True, 0=False |
+
+
+ IsPrimaryKey |
+ 任何对象 |
+ 是否为PRIMARY KEY约束。1=True, 0=False |
+
+
+ IsProcedure |
+ 任何对象 |
+ 是否为存储过程。1=True, 0=False |
+
+
+ IsRule |
+ 任何对象 |
+ 返回0。 |
+
+
+ IsScalarFunction |
+ 函数 |
+ 是否为标量值函数。1=True, 0=False |
+
+
+ IsSchemaBound |
+ 函数、视图 |
+ 返回0。 |
+
+
+ IsTable |
+ 表 |
+ 是否为表。1=True, 0=False |
+
+
+ IsTableFunction |
+ 函数 |
+ 是否为表值函数。1=True, 0=False |
+
+
+ IsTrigger |
+ 任何对象 |
+ 是否为触发器。1=True, 0=False |
+
+
+ IsUserTable |
+ 表 |
+ 是否为用户表。1=True, 0=False |
+
+
+ IsView |
+ 视图 |
+ 是否为视图。1=True, 0=False |
+
+
+ OwnerId |
+ 任何对象 |
+ 返回对象所有者的oid。 |
+
+
+ ExeclsQuotedIdentOn |
+ 函数、存储过程、触发器、视图 |
+ 返回1。 |
+
+
+ ExeclsIsAnsiNullsOn |
+ 函数、存储过程、触发器、视图 |
+ 返回1。 |
+
+
+ TableFulltextPopulateStatus |
+ 表 |
+ 返回0。 |
+
+
+ TableHasVarDecimalStorageFormat |
+ 表 |
+ 返回0。 |
+
+
+
+
+ 示例:
+ 其中database为当前数据库
+
+ ```
+ CREATE TABLE sys.students (
+ id SERIAL PRIMARY KEY,
+ name VARCHAR(100) NOT NULL,
+ age INT DEFAULT 0,
+ grade DECIMAL(5, 2)
+ );
+ set search_path = 'sys';
+ select objectproperty(object_id('students'), 'ownerid') as ownerid;
+ ownerid
+ ---------
+ 10
+ (1 row)
+ select objectproperty(object_id('sys.students'), 'istable') as ownerid;
+ ownerid
+ ---------
+ 1
+ (1 row)
+ select objectproperty(object_id('database.sys.students'), 'isview') as ownerid;
+ ownerid
+ ---------
+ 0
+ (1 row)
+ ```
\ No newline at end of file