openGauss支持的常量和宏

54 阅读1分钟

openGauss支持的常量和宏

1、CURRENT_CATALOG :当前数据库

openGauss=# SELECT CURRENT_CATALOG;
current_database
------------------
openGauss
(1 row)

2、CURRENT_ROLE :当前用户

openGauss=# SELECT CURRENT_ROLE;
current_user
--------------
omm
(1 row)

3、CURRENT_SCHEMA :当前数据库模式

openGauss=# SELECT CURRENT_SCHEMA;
current_schema
----------------
public
(1 row)

4、CURRENT_USER :当前用户

openGauss=# SELECT CURRENT_USER;
current_user
--------------
omm
(1 row)

5、LOCALTIMESTAMP :当前会话时间(无时区)

openGauss=# SELECT LOCALTIMESTAMP;
         timestamp
----------------------------
2015-10-10 15:37:30.968538
(1 row)

6、SESSION_USER :当前系统用户

openGauss=# SELECT SESSION_USER;
session_user
--------------
omm
(1 row)

7、SYSDATE :当前系统日期

openGauss=# SELECT SYSDATE;
sysdate
---------------------
2015-10-10 15:48:53
(1 row)

8、USER :当前用户,此用户为CURRENT_USER的别名

openGauss=# SELECT USER;
current_user
--------------
omm
(1 row)