Bitstring, "char" type, parameter fixes.

This is based on pull request #362 and implements the following:

* BitString are now correctly returned from backend, and is correctly handled in parameters.
* BIT(1) maps to the .NET bool type and other BIT maps to BitString.
* Output parameters now work correctly for prepared queries.
* DbType.Time is now mapped to interval.
* The "char" type now returns a Char instead of a String.
* Type OIDs are sent in the Parse message.
* Optimizations when all format codes are the same in Bind message.
* Automatically infer parameter value types when setting a value.
* New NpgsqlDbType.Unknown that specifies that Npgsql should not try infer the value type, nor cast the value when written to sql, but simply write a literal string in text form.
If we set a type oid, that is final. Postgresql will not change it. The
case when we pass a byte array but the backend expects an int due to
context, it will try to do an implicit cast. If that fails, an error will
be thrown.
Den 21 okt 2014 12:40 skrev "Shay Rojansky" <notifications@github.com>:

> In Npgsql/NpgsqlParameter.cs:
>
> > @@ -608,17 +605,34 @@ public override void ResetDbType()
> >          internal bool IsBound { get; private set; }
> >          internal byte[] BoundValue { get; private set; }
> >          internal short BoundFormatCode { get; private set; }
> > +        internal int TypeOID { get; private set; }
> > +
> > +        internal void SetTypeOID(int oid, NativeToBackendTypeConverterOptions nativeToBackendTypeConverterOptions)
> > +        {
> > +            TypeOID = oid;
> > +
> > +            // If the db backend specified another type, we have to use that one.
> > +            NpgsqlBackendTypeInfo backendTypeInfo;
> > +            nativeToBackendTypeConverterOptions.OidToNameMapping.TryGetValue(TypeOID, out backendTypeInfo);
> > +            if (backendTypeInfo != null && backendTypeInfo.Name != TypeInfo.Name && !explicitUnknown)
>
> Another note on the above: what if the user specifies a type, but when the
> backend actually parses the columns it sees that it's the wrong type? For
> example I set the the parameter to byte[], but the column into which it
> should go is an int? I assume in this case Postgresql returns an error, but
> I just wanted to make sure...
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/npgsql/npgsql/pull/390/files#r19140374>.
>