-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
postgres provider: allow detection of empty views (fixes #13638)
- Loading branch information
Showing
2 changed files
with
3 additions
and
6 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
441f6f8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jef-n Your change now not only allows empty queries/views but it also allows parts of the key to be NULL. Is this intended?
If not, I would suggest simply adding the clause
IS NOT FALSE
to thebool_and()
function to avoid the problematic NULL result for this special case.The following query does the same check as the one before except it returns true for an empty relation:
441f6f8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the problem with keys being partly
NULL
in the first place?441f6f8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The usual comparison semantics don't apply to NULL values. E.g.
"Attribute" = NULL
never yields TRUE, even if the attribute is NULL. It always yields NULL.So at least here would be a problem. Maybe somewhere else, too.
See also my newly filed bug 13641.