New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable constraint [CORE1924] #2358
Comments
Commented by: Mark Stein (mark stein) It would be great to have such a functionality! I'm looking for a way do achieve that, but can't find anything. This article: says "[...]Alternatively, you can disable the constraints during the import and turn them back on later.[...]" so it seems to be possible. I would like to know how. Can anyone help me with this please? If this is not possible yet, then please consider it for one of the next releases. Thanks, |
If standard-compliant |
I'd prefer it raising an error and suggesting to use ALTER CONSTRAINT instead, but it will break backward compatibility. If it's allowed, I'd expect the change to be propagated to the constraint using the altered index/trigger, as the state should be stored at the constraint level too and both states should be in sync. |
Why to duplicate the state? As any other denormalization it is just a source of troubles. |
We're going to support FKs without indices, so the state should be stored at the constraint level. |
Not every kind of constraints requires index ever |
Ok, but let's wait until FKs without indices are implemented to see implementation details and if they don't have a place for "active" flag. PS: Check constraints require triggers which also have own "inactive" flag. NULL constraints have corresponding flags in record format IIRC. |
Submitted by: @cincuranet
Votes: 14
Temporaly disabling constraints (FK, check, ...) using:
ALTER TABLE <table> DISABLE <constraint> and ALTER TABLE <table> ENABLE <constraint>
This more or less similar to CORE1084, but with wider application.
The text was updated successfully, but these errors were encountered: