Re: SQL99, CREATE CAST, and initdb - Mailing list pgsql-hackers

From Tom Lane
Subject Re: SQL99, CREATE CAST, and initdb
Date
Msg-id 3206.1024966524@sss.pgh.pa.us
Whole thread Raw
In response to Re: SQL99, CREATE CAST, and initdb  (Thomas Lockhart <lockhart@fourpalms.org>)
Responses Re: SQL99, CREATE CAST, and initdb
List pgsql-hackers
I said:
> Thomas Lockhart <lockhart@fourpalms.org> writes:
>> I've got another issue with casting which I've run into while testing
>> this feature; afaict invoking an explicit CAST() in SQL does not
>> guarantee that the function of the expected name would be called, if
>> that function does not have the implicit flag set.

> [ scratches head ]  Whether the flag is set or not shouldn't matter;
> if the cast function is needed it will be called.  Were you perhaps
> testing binary-compatible cases?

Another possibility is that you got burnt by some schema-related issue;
cf the updated conversion docs at
http://developer.postgresql.org/docs/postgres/typeconv-func.html

IIRC, a function is only considered to be a cast function if it matches
by name *and schema* with the target type.  So if you, for example,
make a function public.int4(something), it'll never be considered a
cast function for pg_catalog.int4.  I had some doubts about that rule
when I put it in, but so far have not thought of an alternative I like
better.
        regards, tom lane




pgsql-hackers by date:

Previous
From: Thomas Lockhart
Date:
Subject: Re: SQL99, CREATE CAST, and initdb
Next
From: Tom Lane
Date:
Subject: Re: SQL99, CREATE CAST, and initdb