Constraints parameters
The following configuration parameters control how Vertica evaluates and enforces constraints. All parameters are set at the database level through
ALTER DATABASE
.
Three of these parameters—EnableNewCheckConstraintsByDefault, EnableNewPrimaryKeysByDefault, and EnableNewUniqueKeysByDefault—can be used to enforce CHECK, PRIMARY KEY, and UNIQUE constraints, respectively. For details, see Constraint enforcement.
- EnableNewCheckConstraintsByDefault
- Boolean parameter, set to 0 or 1:
-
0: Disable enforcement of new CHECK constraints except where the table DDL explicitly enables them.
-
1 (default): Enforce new CHECK constraints except where the table DDL explicitly disables them.
-
- EnableNewPrimaryKeysByDefault
- Boolean parameter, set to 0 or 1:
-
0 (default): Disable enforcement of new PRIMARY KEY constraints except where the table DDL explicitly enables them.
-
1: Enforce new PRIMARY KEY constraints except where the table DDL explicitly disables them.
Note
Vertica recommends enforcing constraints PRIMARY KEY and UNIQUE together. -
- EnableNewUniqueKeysByDefault
- Boolean parameter, set to 0 or 1:
-
0 (default): Disable enforcement of new UNIQUE constraints except where the table DDL explicitly enables them.
-
1: Enforce new UNIQUE constraints except where the table DDL explicitly disables them.
-
- MaxConstraintChecksPerQuery
- Sets the maximum number of constraints that
ANALYZE_CONSTRAINTS
can handle with a single query:-
-1 (default): No maximum set,
ANALYZE_CONSTRAINTS
uses a single query to evaluate all constraints within the specified scope. -
Integer > 0: The maximum number of constraints per query. If the number of constraints to evaluate exceeds this value,
ANALYZE_CONSTRAINTS
handles it with multiple queries.
For details, see Distributing Constraint Analysis.
-