U0100056: GaussDB does not support index generation using non-immutable functions such as TO_DATE or TO_CHAR
Description
GaussDB does not support index generation using non-immutable functions such as TO_DATE or TO_CHAR.
Database Type and Version
- Source database type and version: Oracle versions supported by UGO
- Target database type and version: GaussDB versions supported by UGO
Syntax Example
create index index_range_index on range_index(to_date(date1,'yyyy-mm-dd')) ;
Suggestion
No automatic solution is available. Encapsulate TO_DATE and TO_CHAR within a user-defined immutable function and reference the function in an index expression.
Modified SQL statements compatible with GaussDB:
CREATE OR REPLACE FUNCTION dsc_fn_to_date
( i_date IN timestamp
, i_date_fmt IN TEXT )
returns timestamp without time zone
IMMUTABLE
AS
$PG$
SELECT TO_DATE(i_date, i_date_fmt)
$PG$
LANGUAGE SQL;
---index
create index index_range_index on range_index(dsc_fn_to_date(date1,'yyyy-mm-dd')) ; What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot