Re: User-defined typle similar to char(length) varchar(length) - Mailing list pgsql-hackers

From Teodor Sigaev
Subject Re: User-defined typle similar to char(length) varchar(length)
Date
Msg-id 44D34D9B.9050401@sigaev.ru
Whole thread Raw
In response to Re: User-defined typle similar to char(length) varchar(length)  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: User-defined typle similar to char(length) varchar(length)
List pgsql-hackers
>> But that makes NUMERIC(x,y) impossible to represent.

> Well, we have to special-case INTERVAL anyway (because its cramming some
> truly bizarre things into typmod), and it wouldn't bother me too much to
> special-case NUMERIC as well.

We have a lot of special transformation of type based on typmod (char, bit, 
float), a lot of additional keywords ("national", "varying" etc), a lot of 
hardcoded synonyms (real->float4 etc). BPchar typemod stores value with added 
VARHRDSZ. Sorry, I don't see regular way to support those exceptions even with 
typmod_in/typemod_out functions per type...

User defined type can check typmod option in its input or cast function, I don't 
think that will be very expensive.

> one value and you enter two or vice versa.  NUMERIC can finesse this
> because the default for scale is zero, but in the general case that
> wouldn't work so well.
I agree.

Is there a chance to commit this patch to 8.2?

-- 
Teodor Sigaev                                   E-mail: teodor@sigaev.ru
  WWW: http://www.sigaev.ru/
 


pgsql-hackers by date:

Previous
From: "Jonah H. Harris"
Date:
Subject: Re: 8.2 features status
Next
From: "Jonah H. Harris"
Date:
Subject: Re: standard interfaces for replication providers