MSC-PG0028

TRUNCATE 'RESTRICT' behavior should be used when table has no references. If have references should be added.

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

Severity

Low

Description

When truncating a table that has references, the user should specify in the truncate table list all the tables that are referenced between them. Otherwise, an error is thrown on PostgreSQL. So we should validate manually and add the references tables if required or take a decision about the truncated table.

Code Example

Input code:

TRUNCATE table_with_identity RESTRICT;

Output code:

--** MSC-WARNING - MSC-PG0024 - THE TRUNCATE RESTRICTED BEHAVIOR SHOULD BE USED WHEN TABLE HAS NOT REFERENCES, IF HAVE REFERENCES PLEASE ADDED. **
TRUNCATE table_with_identity;

Recommendations

Last updated