Re: test datatype for ANY - Mailing list pgsql-general

From Tom Lane
Subject Re: test datatype for ANY
Date
Msg-id 17733.1108177349@sss.pgh.pa.us
Whole thread Raw
In response to Re: test datatype for ANY  (Michael Fuhr <mike@fuhr.org>)
List pgsql-general
Michael Fuhr <mike@fuhr.org> writes:
> On Fri, Feb 11, 2005 at 03:37:01PM -0500, Tom Lane wrote:
>> [ thinks about that for awhile... ]  Oh, I see.  The reason this appears
>> to work is that plpgsql compiles a separate version of the function for
>> each actual parameter datatype that is used in a given session.  So in
>> your example, you get a separate version for integer, numeric, etc.

> Is that the general case for polymorphic functions?

AFAIR all the PLs that support polymorphism do it that way.  It's not
the only way it could be done, but it was the easiest way to bolt
polymorphism onto the existing code, which generally assumed that
every data value in the function has a fixed datatype.

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: pg_dump dumping data in order? (used to in 7.4 but not now in 8?)
Next
From: Jeff Davis
Date:
Subject: Re: regular expressions in query