Skip to main content

CURRENT_TIMESTAMP on UPDATE CURRENT_TIMESTAMP in the table definition

  • February 5, 2014
  • 1 reply
  • 10 views

Kiran_1
Hi, I am trying to migrate from mysql to vertica.
   
In mysql, the db provides the functionality to update the table timestamps automatically by using 'ON UPDATE' construct 
For eg: In Mysql
create <table.name>(
<column_name> timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);

Does a similar functionality exists in Vertica?

Else do I need to include(Insert/Update) CURRENT_TIMESTAMP in each of the update statement

Thanks in advance

1 reply

Ben_Vandiver
Forum|alt.badge.img
  • Participating Frequently
  • February 15, 2014
Vertica does not support trigger-like features like this one.  In general, calling current_timestamp() carries enough overhead that it will be noticeable for large inserts.  I would suggest statement_timestamp() which is constant over a single statement and considerably faster.