colpivot icon indicating copy to clipboard operation
colpivot copied to clipboard

Error when querying an empty table

Open htatche opened this issue 8 years ago • 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 ?

htatche avatar Apr 19 '16 21:04 htatche

#4

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

anttilinno avatar May 10 '16 10:05 anttilinno