Re: getTypeIOParam is wrong for domains over array types? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: getTypeIOParam is wrong for domains over array types?
Date
Msg-id 7247.1174318937@sss.pgh.pa.us
Whole thread Raw
In response to Re: getTypeIOParam is wrong for domains over array types?  ("Merlin Moncure" <mmoncure@gmail.com>)
List pgsql-hackers
"Merlin Moncure" <mmoncure@gmail.com> writes:
> On 3/19/07, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> I think probably the right solution is to adjust getTypeIOParam so that
>> it only examines typelem for base types (typtype = 'b').  Can anyone
>> see a downside to that?

> will that skip intermediate check constraints...so that if you have
> domain d1 int, d2 d1, d3 d2, and d2 has check constraint on it, will
> d2 constraint still get evaluated?

Yeah, that'll still work.  The point here is that domain_in has to be
passed d3's type OID to start with.  If we have a stack of nested
domains over an array type, they'll all have typelem equal to the array
element type (so that they can be subscripted the same as the base type
could be).  I think you're confusing typelem with typbasetype ...
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Merlin Moncure"
Date:
Subject: Re: getTypeIOParam is wrong for domains over array types?
Next
From: "Simon Riggs"
Date:
Subject: Re: CREATE INDEX and HOT (was Question:pg_classattributes and race conditions ?)