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 the user did not specify a parameter type and the value is null, it is
up to the backend to deduce the type. This type might be something that
npgsql does not recognise. Then we send the value as text and hope it will
work. That means if a user wants to use a (new) type npgsql does not
support, it can still be used.
Den 21 okt 2014 10:59 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)
>
> Probably add a Trace.Assert here, that the OID sent by the backend exists
> and the name corresponds. If I understand everything correctly it should
> never happen.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/npgsql/npgsql/pull/390/files#r19136405>.
>