The FromField typeclass, for converting a single value in a row
returned by a SQL query into a more useful Haskell representation.
Note that each instance of FromField is documented by a list of
compatible postgresql types.

A Haskell numeric type is considered to be compatible with all
PostgreSQL numeric types that are less accurate than it. For instance,
the Haskell Double type is compatible with the PostgreSQL's 32-bit
int type because it can represent a int exactly. On the other hand,
since a Double might lose precision if representing PostgreSQL's 64-bit
bigint, the two are not considered compatible.

Because FromField is a typeclass, one may provide conversions to
additional Haskell types without modifying postgresql-simple. This is
particularly useful for supporting PostgreSQL types that postgresql-simple
does not support out-of-box. Here's an example of what such an instance
might look like for a UUID type that implements the Read class:

Note that because PostgreSQL's uuid type is built into postgres and is
not provided by an extension, the typeOid of uuid does not change and
thus we can examine it directly. Here, we simply pull the type oid out
of the static table provided by postgresql-simple.

On the other hand if the type is provided by an extension, such as
PostGIS or hstore, then the typeOid is not stable and can vary from
database to database. In this case it is recommended that FromField
instances use typename instead.

Documentation

Returns a list of exceptions if the conversion fails. In the case of
library instances, this will usually be a single ResultError, but
may be a UnicodeException.

Implementations of fromField should not retain any references to
the Field nor the ByteString arguments after the result has
been evaluated to WHNF. Such a reference causes the entire
LibPQ.Result to be retained.

For example, the instance for ByteString uses copy to avoid
such a reference, and that using bytestring functions such as drop
and takeWhile alone will also trigger this memory leak.

Returns the data type name. This is the preferred way of identifying
types that do not have a stable type oid, such as types provided by
extensions to PostgreSQL.

More concretely, it returns the typname column associated with the
type oid in the pg_type table. First, postgresql-simple will check
built-in, static table. If the type oid is not there, postgresql-simple
will check a per-connection cache, and then finally query the database's
meta-schema.

Returns the name of the object id of the table associated with the
column, if any. Returns Nothing when there is no such table;
for example a computed column does not have a table associated with it.
Analogous to libpq's PQftable.