v.24.5Improvement

Ignore allow_suspicious_primary_key on ATTACH, verify on ALTER

Ignore allow_suspicious_primary_key on ATTACH and verify on ALTER. #64202 (Azat Khuzhin).
Ignore the allow_suspicious_primary_key setting during ATTACH operations and enforce its verification only on ALTER commands.

Why it matters

This feature addresses the issue of unwanted restrictions during ATTACH operations by bypassing the allow_suspicious_primary_key check, while still preserving data integrity and correctness by verifying this setting on ALTER statements. It improves usability by making table attachment smoother without compromising validation during table schema modifications.

How to use it

Users do not need to explicitly enable this feature. When attaching tables using the ATTACH command, the allow_suspicious_primary_key setting will be ignored automatically. However, when performing ALTER operations that affect primary keys, the setting will be checked as usual to ensure safety.