Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

dbdriver of postgresql does not support numeric field type. #91

Closed
arjan opened this Issue Sep 5, 2011 · 3 comments

Comments

Projects
None yet
4 participants
Owner

arjan commented Sep 5, 2011

From http://code.google.com/p/zotonic/issues/detail?id=86

What steps will reproduce the problem?
1.when field type of postgresql table is numeric, the float type data is
decode as binary string, not the correct float number.
2.
3.

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?

Please provide any additional information below.
Code in pgsql_binary.erl is no numeric type support.

Contributor

helllamer commented Oct 5, 2011

Yes, transparent numeric support absence is not good.

I asked myself about this problem some time ago, and rapidly found only one good answer for me:

In model i've used the following code:

Result = z_db:q("SELECT id, price_numeric FROM paylist ..."),
[ {Id, z_convert:to_float(PriceNumeric)} || {Id,PriceNumeric} <- Result ].

But... i've unable to add same converion to epgsql: epgsql_binary operating over unknown for me binaries. In other words, i don't understant how to convert a epgsql-binary < < 0,0,1,2,222,333,... > > to something like <<"431.32525">>. epgsql does this job automatically with unknown types, but i've not found the code that does this job.

Same problem and same resolution i was applied for hstore[1] data type. But with hstore also there are anothen problem: it has no stable OID (because it is option bundled extension).

[1] - http://www.postgresql.org/docs/current/static/hstore.html

Owner

kaos commented Dec 11, 2012

Putting on Wish list due to enhancement label (and age).

Owner

mworrell commented Feb 16, 2015

Closing, as we are now using vanilla epgsql, if this is still needed the an issue should be files there.

@mworrell mworrell closed this Feb 16, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment