hnsl/colpivot

Error when querying an empty table

htatche opened this issue · 1 comments

Hi, I really appreciate your work since it has solved a problem at my company in which we also needed to pivot an undefined number of results to columns.

Right now I am trying to investigate how can I avoid an ERROR when the table that I am querying is empty:

ERROR: upper bound of FOR loop cannot be null CONTEXT: PL/pgSQL function colpivot(character varying,character varying,character varying[],character varying[],character varying,character varying) line 67 at FOR with integer loop variable

Can you give any help with this ?

#4

You could use this change. I'm testing at the moment, if this change suits my needs.