-
Notifications
You must be signed in to change notification settings - Fork 819
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix updateable result set when there are primary keys and unique keys (…
…#2228) * fix: change to updatable result set to use correctly primary or unique keys Fix issues introduced in PR# 2199 causing problems when updating tables with PK and UK. Originally updatable result sets support only primary keys, with the aforementioned change and this fix unique keys are also eligible to enable updatable result set. This change will find the better suited primary or unique key that has all the available columns in the query, but if no match is found it will continue to fail as it used to. Closes issue 2196 * fix: changes to updatable result set to disable use of unique keys with nullable columns Adding logic to ensure all columns in the constraint (primary/unique) are non-nullable (always true for PKs) to guarantee 1-1 updates * fix: removal of added code after nullable unique keys are excluded No need to have IS NULL when nullable keys are not allowed to guarantee 1-1 updates * fix: exclude indices with expressions for updatable result sets Indices with expressions cannot be used (unless expression parsing / resolution is implemented properly - currently don't see a way to get individual list elements from pg_index.indexprs to enable proper expression filtering (pg_get_expr gives the expression, but unable to map this to a specific attribute in the index) Co-authored-by: Marquez Grabia, Christian <Christian.MarquezGrabia@sabre.com>
- Loading branch information
Showing
3 changed files
with
217 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters