On Sat, Oct 16, 2010 at 6:13 PM, Paul Ramsey <pramsey@cleverelephant.ca> wrote:
> On Sat, Oct 16, 2010 at 10:17 AM, Peter Eisentraut <peter_e@gmx.net> wrote:
>> On lör, 2010-10-16 at 09:23 -0700, Paul Ramsey wrote:
>>> >> (And, if we are going to break everything
>>> > in sight, now would be a good time to think about changing typmod to
>>> > something more flexible than one int32.)
>>>
>>> As someone who is jamming geometry type, spatial reference number and
>>> dimensionality into said 32bit typmod, let me say emphatically ...
>>> Amen!
>>
>> So what kind of data structure would you like for a typmod?
>
> I'm a primitive enough beast that just having 64-bits would make me
> happy. As a general matter though, a bytea?
Yeah. It strikes me that there are three main kinds of things people
might want to represent:
1. An integer. e.g. for a numeric, precision or scale; for a varchar,
length; for an array, number of dimensions.
2. An OID. e.g. for varchar or text, a collation OID.
3. Recursive structure. So you might have an array (which is
one-dimensional) containing strings (which are limited to 80
characters and collated in Klingon). You want to hold onto all of
those details somehow.
There might be use cases for even crazier things - like packing all
the field names and types for a record object in there... but maybe
that's too crazy to be workable.
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company