[database-devel] Arrays and postgresql-simple

Jeff Davis pgsql at j-davis.com
Sat Aug 18 20:48:16 CEST 2012


On Thu, 2012-08-16 at 19:18 -0400, Leon Smith wrote:
> Ok,  I really want to get the TypeInfo structure more or less
> "correct" before we release this work.
> 
> After reviewing the documentation regarding the pg_type table,  I
> think it would be a mistake to "mandate" an interpretation of the
> table in the new TypeInfo structure,  as my suggested TypeInfo would
> do.   Rather, I think it would be better to represent (part of) the
> pg_type table faithfully,  closer to what Bas originally did.
> However,  I do think it should be a properly recursive type.

It doesn't look like TypeInfo is returned to users, so I don't see a
major problem with using a more convenient representation if we find
one. What am I missing?

> So my new suggestion for the TypeInfo structure is this:
> 
> data TypeInfo = TypeInfo 
>     { typoid      :: {-# UNPACK #-} !PQ.Oid
>     , typcategory :: {-# UNPACK #-} !Char
>     , typdelim    :: {-# UNPACK #-} !Char
>     , typname     :: !ByteString
>     , typelem     :: Maybe TypeInfo
>     }
> 
We'll be omitting some information there, notably the subtypes for range
types and the subtypes for composite types. I assume that you intend to
add those organically as the need arises (e.g. keep adding in more parts
of the PG catalogs)?

Regards,
	Jeff Davis




More information about the database-devel mailing list