MSC-PG0007

Constraint index parameter not supported

This is a deprecated version of the SnowConvert documentation, please visit the official site HERE.

Severity

Low

Description

The use of index parameters in constraints is not supported in Snowflake. The index parameters are the following:

  • INCLUDE

  • WITH

  • USING INDEX TABLESPACE

Code Example

Input Code:

CREATE TABLE Table1 (
    code        char(5),
    date_prod   date,
    CONSTRAINT production UNIQUE(date_prod) INCLUDE(code)
);

CREATE TABLE Table2 (
    name    varchar(40),
    UNIQUE(name) WITH (fillfactor=70)
);

CREATE TABLE Table3 (
    name    varchar(40),
    PRIMARY KEY(name) USING INDEX TABLESPACE tablespace_name
);

Output Code:

CREATE TABLE Table1 (
    code        char(5),
    date_prod   date,
    CONSTRAINT production UNIQUE(date_prod)
-- ** MSC-WARNING - MSC-PG0007 - INCLUDE PARAMETER NOT APPLICABLE. CONSTRAINT INDEX PARAMETERS ARE NOT SUPPORTED IN SNOWFLAKE. **
--                                            INCLUDE(code)
);

CREATE TABLE Table2 (
    name    varchar(40),
    UNIQUE(name)
-- ** MSC-WARNING - MSC-PG0007 - WITH PARAMETER NOT APPLICABLE. CONSTRAINT INDEX PARAMETERS ARE NOT SUPPORTED IN SNOWFLAKE. **
--                 WITH (fillfactor=70)
);

CREATE TABLE Table3 (
    name    varchar(40),
    PRIMARY KEY(name)
-- ** MSC-WARNING - MSC-PG0007 - USING PARAMETER NOT APPLICABLE. CONSTRAINT INDEX PARAMETERS ARE NOT SUPPORTED IN SNOWFLAKE. **
--                      USING INDEX TABLESPACE tablespace_name
);

Recommendations

Last updated