Despite the COVID-19 outbreak, our team continues operating at full speed. We are always here to support and answer all your questions.

Feel free to reach out by filling this quick form.

Fill the form
Get Free Trial

Specify data types for PHP data compressor from postgres

Simon asked on May 21, 2019

I’m trying to use FlexMonster to create a Pivot table from a Postgres source.
So far I’ve setup a basic PHP compressor server using your example code. This connects to the Postgres DB and streams the data.
I can see the data coming through correctly to the table, but it looks like the type information is somehow lost, and everything is interpreted as strings. (for example I can only aggregate as “Count” or “Distinct Count” and not “Sum”)
If I change the compressor to read from a csv file instead, everything works as expected, and the data types look correct.
Is there someway to preserve the data types using the PHP Postgres compressor? Or do I need to use another solution?

5 answers

Dmytro Zvazhii Dmytro Zvazhii Flexmonster May 22, 2019

Hello Simon,
Thank you for writing to us.
It seems that the column types are not recognized correctly by the Data Compressor.
As a temporary solution, we recommend using SQL alias to define the data types explicitly. Please refer to the following thread for the example:
Also, could you please provide us with the SQL schema of your table? That would help us a lot to resolve the issue with the Data Compressor.
Waiting to hear from you.

Simon May 22, 2019

Thanks Dmytro,
I’ve attached the schema for this database – currently we select everything from this (“SELECT * FROM …”)

Dmytro Zvazhii Dmytro Zvazhii Flexmonster May 22, 2019

Hello Simon,
Thank you for providing us with the screenshot of the schema. That was really helpful.

It seems that the double precision data type is not recognized correctly.
Our dev team will add the necessary update in the minor release with ETA Jun17.

Meanwhile, you can use the suggested workaround for testing.
Please let us know if everything works fine for you.

Simon May 23, 2019


Vera Didenko Vera Didenko Flexmonster June 18, 2019

Hello, Simon,

We are glad to announce that the issue with recognizing numeric types from PostgreSQL was fixed.

This is available in the 2.7.8 version of Flexmonster:

You are welcome to update the component: 

A kind reminder is to update Flexmonster Data Compressor also:!compressor 

Please let us know if everything works fine.

We are looking forward to hearing from you.

Best Regards,


Please login or Register to Submit Answer