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
Handle CONSTRAINT TRIGGER on DB Manager/PostgreSQL. #35983
Handle CONSTRAINT TRIGGER on DB Manager/PostgreSQL. #35983
Conversation
@gioman , all green. Does it look good to you? |
I'm not a reviewer. A dev will do it. |
@espinafre is this PR safe also when using old PostgreSQL releases like 9.6? |
@gioman it should be safe, but a test of current master before merging the backport would be appreciated. Please note that the 3.10 backport has been frozen for a dev cycle to have time to deal with potential issues before merging. |
@m-kuhn sure. Master in the nightly repo for Ubuntu bionic is stuck at code revision from 16 days ago, any idea why? At home with a tiny laptop compiling is not really an option. |
Maybe @jef-n knows more? |
the addition of qgis_process broke the packaging process - fixed in 8ee4d05 - the current build should complete (http://qgis2.qgis.org:1080/cgi-bin/build.sh) |
@jef-n thanks! |
Fixes #35967
Despite appearing as constraints on the catalog pg_constraint, they are not really constraints, but rather a special kind of trigger, as seen here: https://www.postgresql.org/docs/12/catalog-pg-constraint.html and here: https://www.postgresql.org/docs/12/sql-createtrigger.html .
The following table/trigger shows the issue:
All the other constraint types that might appear on the catalog pg_constraint according to the PostgreSQL documentation are handled by DB Manager:
QGIS/python/plugins/db_manager/db_plugins/plugin.py
Line 1284 in 2e7bebc
Those are SQL standard, the CONSTRAINT TRIGGER is a PostgreSQL extension (according to the PostgreSQL docs), and I think it is not really a constraint in the traditional sense.
I believe this should be backported to 3.12 and 3.10.