Skip to content
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

Return with false, if there are no results #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

anttilinno
Copy link

No description provided.

@@ -103,8 +109,10 @@ create or replace function colpivot(
foreach col in array key_cols loop
if i > 0 then
on_e := on_e || ' and ';
on_e := on_e || '(' || ali || '.' || quote_ident(col) || ' = _key.' || quote_ident(col) || ' OR (' || ali || '.' || quote_ident(col) || ' IS NULL AND _key.' || quote_ident(col) || ' IS NULL)) ';
else
on_e := on_e || ali || '.' || quote_ident(col) || ' = _key.' || quote_ident(col) || ' ';
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does the first column not get the null comparison check? It's probably obvious but it was so long that I wrote this code.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beats me. I would have to test the function with and without checking for null. I'm also in the "fire and forget" mode 😆 But as I use it in the production, I guess it works regardless of maybe useless bloat.
I will check it out, if I have time for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants