[Postgres-xl-general] Prepared statement failure?

Aaron Jackson ajackson at revionics.com
Tue Jul 22 19:25:36 PDT 2014


To my knowledge, smallint is the only one that has triggered this behavior.  But I have not tested other configurations.  My guess is that some other drivers may handle the case of int length 1 properly, however, in this case, the non-prepared and prepared statements give different behavior.

Also, it only occurs once there is a resultset to read... so, simply preparing the value does not cause the problem to occur.  I'm guessing that part of the protocol involves serializing the field spec to the wire so that the remote can deserialize it.  I'm not sure where that serialization occurs so, I'm still hunting.  Any hints would be much appreciated.

Aaron
________________________________
From: Mason Sharp [msharp at translattice.com]
Sent: Tuesday, July 22, 2014 5:11 PM
To: Aaron Jackson
Cc: postgres-xl-general at lists.sourceforge.net
Subject: Re: [Postgres-xl-general] Prepared statement failure?

Hi Aaron,



On Tue, Jul 22, 2014 at 2:46 PM, Aaron Jackson <ajackson at revionics.com<mailto:ajackson at revionics.com>> wrote:
So a colleague of mine noticed that when they prepared a statement with Postgres-XL that it would fail and that with standard Postgres it would not.  So, I looked a little further and it appears that Npgsql (the postgresql driver for .NET) is failing because the fieldsize being sent back for smallint after being prepared is 1, whereas standard postgresql returns a fieldsize of 2.

I am doing my best to look down through the way that postgresql is rewriting queries to understand what is happening but it appears to be reducing the fieldsize down to that of a single byte.  Ngpsql fails because it believes that ints only come in 3 flavors (2, 4 and 8 byte).  Now, I could patch Npgsql, but something seems strange here.  I’m okay with optimization but not at the expense of breaking existing drivers.  I will look further into this and see if I can’t uncover why Postgres-XC/XL exhibits this behavior and not standard postgres.


That sounds like an issue. To be clear, are prepared statements working for regular integers and bigints, it is just failing for smallints? Only through Npgsql?

I just did a quick prepared statement test with smallint and it seemed to work ok though, but not through Npgsql, just on the psql command line.

Thanks,


--
Mason Sharp

TransLattice - http://www.translattice.com
Distributed and Clustered Database Solutions


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.postgres-xl.org/pipermail/postgres-xl-general-postgres-xl.org/attachments/20140723/c9486dc4/attachment.htm>


More information about the postgres-xl-general mailing list