Re: [Cppcms-users] Cppdb: Bound double constant becomes string of integer
Brought to you by:
artyom-beilis
|
From: Artyom B. <art...@ya...> - 2014-03-13 15:07:41
|
First of all it does makes sense. It is default way for libpq to pass data to the PosgreSQL engine. The binary interface is very problematic for many reasons. (like a requirement to specify the type exactly as the column type for inserts and so on) Results are passed as text as well. The casting is done on prepared statement level, i.e. when you create a prepared statement it just considers the data of specific type (especially when you use ?::type format - it is got rewritten to $1::type which is the way of postgresql to handle the type ambiguities) One thing I need to make sure that the floating point type would actually receive the decimal point for integer values. Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ -------------------------------------------- On Thu, 3/13/14, CN <cn...@fa...> wrote: Subject: Re: [Cppcms-users] Cppdb: Bound double constant becomes string of integer To: cpp...@li... Date: Thursday, March 13, 2014, 4:41 PM I have just created a ticket. Thank you for your attention! It looks to me that all bound constants are sent to database engines as string even when these constants are numbers - integer, float, double, etc. PostgreSQL can properly determine data types and cast strings to numbers when it needs to. However, I wonder data type casting causes performance penalty. Does it make sense, and is it possible, for cppdb to intelligently determine and bind numbers and send them as numeric parameters rather than strings? Regards, CN On Thu, Mar 13, 2014, at 03:40 PM, Artyom Beilis wrote: > 1st I'll look into formatting code - try to make sure that there is > always a decimal point or "E". Can you please open a ticket please? -- http://www.fastmail.fm - The professional email service ------------------------------------------------------------------------------ Learn Graph Databases - Download FREE O'Reilly Book "Graph Databases" is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech _______________________________________________ Cppcms-users mailing list Cpp...@li... https://lists.sourceforge.net/lists/listinfo/cppcms-users |