Today I commited a patch (here, here, and here) to allow parameters explicit typing on plain queries.
What this means? This means that all parameters are sent to backend carrying its explicit type as specified by DbType and/or NpgsqlDbType enums. This will allow better typing matching between client and server. See here for Jon Hanna discussion about it. This explict typing isn't completely new. It was already being applied to function calling. We just decided to apply it to plain queries too.
Now queries are sent this way:
select * from tablea where field_serial = '4'::int4
where they were being sent as:
select * from tablea where field_serial = 4
This modification may lead to problems, as said in discussion above (end of first post), but we hope this can be easily fixed. Please, send your comments about it.
Please, grab a cvs copy of it and give it a try. We soon will be doing a new beta release which will contain this code.
Thanks Jon Hanna, Agrinei and Josh Cooley for discussion about this feature.