常量与宏
openGauss支持的常量和宏请参见表1。
表 1 常量和宏
参数 | 描述 | 示例 |
---|
CURRENT_CATALOG | 当前数据库 | postgres=# SELECT CURRENT_CATALOG;
current_database
\------------------
postgres
(1 row) |
CURRENT_ROLE | 当前用户 | postgres=# SELECT CURRENT_ROLE;
current_user
\------------------
omm
(1 row) |
CURRENT_SCHEMA | 当前数据库模式 | postgres=# SELECT CURRENT_SCHEMA;
current_schema
\------------------
public
(1 row) |
CURRENT_USER | 当前用户 | postgres=# SELECT CURRENT_USER;
current_user
\------------------
omm
(1 row) |
LOCALTIMESTAMP | 当前会话时间(无时区) | postgres=# SELECT LOCALTIMESTAMP;
timestamp
\------------------
2015-10-10 15:37:30.968538
(1 row) |
NULL | 空值 | - |
SESSION_USER | 当前系统用户 | postgres=# SELECT SESSION_USER;
session_user
\------------------
omm
(1 row) |
SYSDATE | 当前系统日期 | postgres=# SELECT SYSDATE;
sysdate
\------------------
2015-10-10 15:48:53
(1 row) |
USER | 当前用户,此用户为CURRENT_USER的别名。 | postgres=# SELECT USER;
current_user
\------------------
omm
(1 row) |
openGauss 2024-03-19 00:45:43