This is a read-only copy of the MariaDB Knowledgebase generated on 2024-11-17. For the latest, interactive version please visit https://mariadb.com/kb/.

DEFAULT CURRENT_TIMESTAMP is not possible

Hi,

I was trying to create a table:

CREATE TABLE asana_dwh.ods_currency_rate_history (
	rate_date date,
	currency_code varchar(3),
	rate float,
	currency_rate_key varchar(32),
	dwh_last_modified DATETIME DEFAULT CURRENT_TIMESTAMP,
	dwh_created DATETIME DEFAULT CURRENT_TIMESTAMP
)ENGINE=Columnstore DEFAULT CHARSET=utf8 ;

Got the following error: " SQL Error [1178] [42000]: (conn:21) The storage engine for the table doesn't support The syntax or the data type(s) is not supported by Columnstore. Please check the Columnstore syntax guide for supported syntax or data types. "

When removing the DEFAULT CURRENT_TIMESTAMP statement it worked fine. What should i use instead of CURRENT_TIMESTAMP?

Thanks.

Answer Answered by Andrew Hutchings in this comment.

Hi,

In 1.0 & 1.1 CURRENT_TIMESTAMP is not supported. We have a ticket to add support for this: https://jira.mariadb.org/browse/MCOL-1039

There is not a good alternative at the moment that will cover every use case because the alternative would need to support DML statements via MariaDB as well as cpimport and API writes.

If you are just doing DML writes and not using cpimport then a TRIGGER may work.

Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.