Thread: Re: [HACKERS] Data type removal

Re: [HACKERS] Data type removal

From
darrenk@insightdist.com (Darren King)
Date:
> > What would be the benefit of making arrays "flags on a field" instead of
> > a "field type in themselves". Seriously, how would this improve _anything_?
>
> In particular, I was thinking of the PostgreSQL module for Python.  It
> has a nice interface, but needs intimate knowledge of the data types.
> Somehow, it seems to be excessively kludgy to have to have e.g. an
> int4 type, and an int4[] type.  When I query a table, if one of the
> fields is an array of integers, then I either want to know that it's
> an array, or it's integer.  If the returned type is "array," then I
> have to magically know that the array is filled with integers.  If
> it's an integer, then I just have to recognize that it's actually a
> series of integers.  With the current setup, there has to be separate
> type handlers for char(2), char(2)[], int4, int4[], int2, int2[],
> float8, float8[], etcetera.  I'd rather have handlers for the base
> type, and an iterator that's used for arrays.
>

FWIW,

Haven't followed this too closely, but there is some array_iterator
code in the contrib directory coutesy of Massimo.

darrenk