colpivot icon indicating copy to clipboard operation
colpivot copied to clipboard

The temporary table doesn't create

Open ShemTovYosef opened this issue 7 years ago • 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

ShemTovYosef avatar Jan 23 '18 12:01 ShemTovYosef

Which error are you getting?

hnsl avatar Feb 14 '18 23:02 hnsl

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

This is in PostgreSQL 10.3.

jtara avatar May 15 '18 03:05 jtara

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.

jtara avatar May 15 '18 04:05 jtara