1+ :sectnums:
12:sectnumlevels: 16
23
4+
35[.text-center]
6+ [discrete]
47== PostgreSQL 函数参考手册
58
6- [%sectnums]
9+
710=== current_catalog
811
912[cols="145,378"]
1013|===
1114h| 函数名称 h| current_catalog
1215| 参数数据类型 | 无输入参数
1316| 函数返回值数据类型 | Name
14- | 函数含义 | 获得当前的database 名称。注意:在SQL标准中,databases被称之为catalogs.
17+ | 函数含义 | 获得当前的database 名称。 +
18+ 注意:在SQL标准中,databases被称之为catalogs。
1519| 使用举例
1620a|
1721[source,sql]
@@ -22,7 +26,6 @@ postgres=# select current_catalog;
2226 postgres
2327(1 row)
2428
25- postgres=#
2629----
2730|===
2831
4144----
4245postgres=# select current_database();
4346 current_database
44- ------------------
45- postgres (1 row)
46- postgres=#
47+ ------------------
48+ postgres
49+ (1 row)
4750----
4851|===
4952
5053
51-
52- === current_query
54+ === current_query()
5355
5456[cols="145,378"]
5557|===
56- h| 函数名称 h| current_query
58+ h| 函数名称 h| current_query()
5759| 参数数据类型 | 无输入参数
5860| 函数返回值数据类型 | text
5961| 函数含义 | 获得client端提交的当前执行的SQL语句的文本
6062| 使用举例
6163a|
62- [source,sql]
64+ [source,sql,sub="none" ]
6365----
6466postgres=# BEGIN;
6567BEGIN
@@ -79,7 +81,6 @@ postgres=*# ROLLBACK;
7981ROLLBACK
8082postgres=#
8183----
82-
8384|===
8485
8586
@@ -532,7 +533,7 @@ postgres=# select pg_jit_available();
532533(1 row)
533534
534535postgres=# select * from pg_config where name='CONFIGURE' AND SETTING LIKE '%--with-llvm%';
535- name | setting
536+ name \ | setting
536537------+---------
537538(0 rows)
538539
@@ -998,8 +999,18 @@ h| 函数名称 h| aclexplode
998999| 函数返回值数据类型 | setof record
9991000| 函数含义 | 解析 acl 权限
10001001| 使用举例
1001- a| postgres=# select aclexplode('{=X/lc0039999,lc0039999=X/lc0039999}'); aclexplode ------------------------- (16877,0,EXECUTE,f) (16877,16877,EXECUTE,f) (2 rows) +
1002- postgres=# postgres=# select \* from aclexplode('{=X/lc0039999,lc0039999=X/lc0039999}'); grantor | grantee | privilege_type | is_grantable ---------+---------+----------------+-------------- 16877 | 0 | EXECUTE | f 16877 | 16877 | EXECUTE | f (2 rows) +
1002+ a| postgres=# select aclexplode('{=X/lc0039999,lc0039999=X/lc0039999}');
1003+ aclexplode
1004+ -------------------------
1005+ (16877,0,EXECUTE,f)
1006+ (16877,16877,EXECUTE,f)
1007+ (2 rows)
1008+ postgres=# postgres=# select \* from aclexplode('{=X/lc0039999,lc0039999=X/lc0039999}');
1009+ grantor \| grantee \| privilege_type \| is_grantable
1010+ ---------+---------+----------------+--------------
1011+ 16877 \| 0 \| EXECUTE \| f
1012+ 16877 \| 16877 \| EXECUTE \| f
1013+ (2 rows)
10031014postgres=#
10041015
10051016|===
@@ -3331,3 +3342,4 @@ a| postgres=# select box(circle '<(0,0),2>'); box ------------------------------
33313342postgres=#
33323343
33333344|===
3345+
0 commit comments