Clock Timestamp
Date/Time Function
Description
Return a timestamp equivalent to the current time including time zone.
Click here to navigate to the PostgreSQL docs page for this syntax.
The function clock_timestamp() is translated to CURRENT_TIMESTAMP() in snowflake
Grammar Syntax
Sample Source Patterns With SELECT Query.
Postgre
Snowflake
Sample Source Patterns With CREATE TABLE.
Timestamp
Postgre
Snowflake
Date, Time, and Interval
Postgre
Snowflake
Observations
In the case of a select with clock_timestamp, ALTER SESSION is added to maintain compatibility with the PostgreSQL, Greenplum, and Redshift formats. And a precision of 3 is added to the CURRENT_TIMESTAMP for the same reason.
MSCINF0039 is added because when a SELECT is executed to the table the format may vary.
The TIMESTAMP_NTZ type is not affected by the ALTER SESSION set timestamp_output_format.
The ALTER SESSION set timestamp_output_format only affects the TIMESTAMP_LTZ and TIMESTAMP_TZ types when a SELECT statement is executed on the specific table. Their precision, which is set to 9 by default, remains unchanged.
Related EWIs
Last updated