hnsl/colpivot

The temporary table doesn't create

Opened this issue · 3 comments

Hi,

I tried with the sample attached in documentation but it doesn't work for me. The table didn't create.
PostgreSQL 9.5.5 on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 5.4.0-6ubuntu1~16.04.2) 5.4.0 20160609, 64-bit

hnsl commented

Which error are you getting?

jtara commented

I have the same issue. There is no error message. It simply does not create the table.

This is in PostgreSQL 10.3.

jtara commented

Pilot error, sorry.

There was indeed an error message which wasn't terribly helpful.

I decided to actually try to example, which - of course - worked, and then worked through what might be wrong with my query.

My DB has upper/lower case columns (because I'm used to working with SQLite, which recognizes mixed-case, and didn't know better) and I think colpivot has some issues with this. It appears you do double-quote column names in SOME CASES, but not all, and doesn't seem to be possible to work-around by adding double-quotes in the input arguments.

I fixed by writing a SELECT to alias all of the columns in my input table to snake_case.