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)
|
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。