Updated on 2025-06-07 GMT+08:00

GaussDB Common Syntax

Converting DATE and TIME Functions

When you convert syntax to GaussDB V2.0-3.2 or earlier versions, the DATE and TIME functions listed in Table 1 return the transaction start time. The time you obtained in the source database is the current system time. In long transactions, the time obtained from the source database is different from that obtained from the target GaussDB database. If the converted statement contains these functions, you need to analyze whether there are long transactions and confirm the impact. If yes, manually modify the functions to ensure final accuracy.

Table 1 DATE and TIME functions

No.

Function

1

CURRENT_DATE

2

CURRENT_TIME

3

CURRENT_TIME(precision)

4

CURRENT_TIMESTAMP(precision)

5

LOCALTIME

6

LOCALTIMESTAMP

7

LOCALTIME(precision)

8

LOCALTIMESTAMP(precision)