1
0
forked from docs/doc-exports
doc-exports/docs/dws/dev/dws_06_0026.html
Lu, Huayi a24ca60074 DWS DEVELOPER 811 version
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-authored-by: Lu, Huayi <luhuayi@huawei.com>
Co-committed-by: Lu, Huayi <luhuayi@huawei.com>
2023-01-19 13:37:49 +00:00

14 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

Examples

CURRENT_CATALOG

Specifies the current database.

1
2
3
4
5
SELECT CURRENT_CATALOG;
current_database
------------------
gaussdb
(1 row)

CURRENT_ROLE

Current role

1
2
3
4
SELECT CURRENT_ROLE;
current_user
--------------
(1 row)

CURRENT_SCHEMA

Current database model

1
2
3
4
5
SELECT CURRENT_SCHEMA;
current_schema
----------------
public
(1 row)

CURRENT_USER

Current user

1
2
3
4
SELECT CURRENT_USER;
current_user
--------------
(1 row)

LOCALTIMESTAMP

Current session time (without time zone)

1
2
3
4
5
SELECT LOCALTIMESTAMP;
         timestamp
----------------------------
2015-10-10 15:37:30.968538
(1 row)

NULL

This parameter is left blank.

-

SESSION_USER

Current system user

1
2
3
4
SELECT SESSION_USER;
session_user
--------------
(1 row)

SYSDATE

Current system date

1
2
3
4
5
SELECT SYSDATE;
sysdate
---------------------
2015-10-10 15:48:53
(1 row)

USER

Current user, also called CURRENT_USER

1
2
3
4
SELECT USER;
current_user
--------------
(1 row)