Updated on 2024-05-28 GMT+08:00

Converting DATE and TIME Functions

When you convert the syntax of target database GaussDB 3.2 or earlier, 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 time. In long transaction scenarios, the time obtained from the source database is different from that obtained from the target GaussDB. 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 the final accuracy.

Table 1 DATE and TIME functions

Function

CURRENT_DATE

CURRENT_TIME

CURRENT_TIME(precision)

CURRENT_TIMESTAMP(precision)

LOCALTIME

LOCALTIMESTAMP

LOCALTIME(precision)

LOCALTIMESTAMP(precision)