Re: On hardcoded type aliases and typmod for user types - Mailing list pgsql-hackers

From Martijn van Oosterhout
Subject Re: On hardcoded type aliases and typmod for user types
Date
Msg-id 20050901093336.GB28062@svana.org
Whole thread Raw
In response to Re: On hardcoded type aliases and typmod for user types  (Dennis Bjorklund <db@zigo.dhs.org>)
List 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@svana.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.

pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Minimally avoiding Transaction Wraparound in VLDBs
Next
From: Martijn van Oosterhout
Date:
Subject: Re: On hardcoded type aliases and typmod for user types