Re: On hardcoded type aliases and typmod for user types

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Dennis Bjorklund <db(at)zigo(dot)dhs(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: On hardcoded type aliases and typmod for user types
Date: 2005-09-01 09:33:42
Message-ID: 20050901093336.GB28062@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Sep 01, 2005 at 11:18:04AM +0200, Dennis Bjorklund wrote:
> String types have 3 modifiers, the length, the charset and the collation.
> The syntax of these are defined by the standard so at least that syntax
> ought to be allowed (even if there are more work to actually do anything
> with charset and collation info).

From a quick browse in google it looks like:

CHAR(4) COLLATE xxx CHARACTER SET yyy

is valid syntax. So I guess that becomes 0 or more modifiers. And a
single int32 is not going to cut it.

More fields (typmod2, typmod3)? Fields explicitly for this purpose
(typcollate and typcharset), array of int32?

Which would make the second argument to the typmod function ARRAY OF
(textpair) or some such. If the function doesn't accept that then this
is a quick indicator that no options are allowed.

Quick thing, should 'mytype' and 'mytype()' be considered the same and
should they default to typmod -1? Currently '()' is not even accepted.

Have a nice day,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Martijn van Oosterhout 2005-09-01 10:46:58 Re: On hardcoded type aliases and typmod for user types
Previous Message Simon Riggs 2005-09-01 09:29:56 Re: Minimally avoiding Transaction Wraparound in VLDBs