doc-exports/docs/dws/dev/dws_06_0026.html
Lu, Huayi e6fa411af0 DWS DEV 830.201 version
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Co-authored-by: Lu, Huayi <luhuayi@huawei.com>
Co-committed-by: Lu, Huayi <luhuayi@huawei.com>
2024-05-16 07:24:04 +00:00

10 KiB

Constant and Macro

Table 1 lists the constants and macros that can be used in GaussDB(DWS).

Table 1 Constants and macros

Parameter

Description

Example SQL Statements

CURRENT_CATALOG

Specifies the current database.

1
SELECT CURRENT_CATALOG;

CURRENT_ROLE

Current role

1
SELECT CURRENT_ROLE;

CURRENT_SCHEMA

Current database model

1
SELECT CURRENT_SCHEMA;

CURRENT_USER

Current user

1
SELECT CURRENT_USER;

LOCALTIMESTAMP

Current session time (without time zone)

1
SELECT LOCALTIMESTAMP;

NULL

This parameter is left blank.

-

SESSION_USER

Current system user

1
SELECT SESSION_USER;

SYSDATE

Current system date

1
SELECT SYSDATE;

or

SELECT now()::DATE;

USER

Current user, which is the same as the value of CURRENT_USER.

1
SELECT USER;