Constant and Macro

Table 1 lists the constants and macros that can be used in openGauss.

Table 1 Constant and macro

Parameter

Description

Example

CURRENT_CATALOG

Specifies the current database.

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

CURRENT_ROLE

Specifies the current user.

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

CURRENT_SCHEMA

Specifies the current database schema.

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

CURRENT_USER

Specifies the current user.

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

LOCALTIMESTAMP

Specifies the current session time (without time zone).

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

NULL

This parameter is left blank.

N/A

SESSION_USER

Specifies the current system user.

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

SYSDATE

Specifies the current system date.

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

USER

Specifies the current user, also called CURRENT_USER.

openGauss=# SELECT USER;
current_user
--------------
omm
(1 row)
Feedback
编组 3备份
    openGauss 2024-11-07 00:55:44
    cancel