diff options
Diffstat (limited to 'doc/src/sgml/typeconv.sgml')
-rw-r--r-- | doc/src/sgml/typeconv.sgml | 75 |
1 files changed, 63 insertions, 12 deletions
diff --git a/doc/src/sgml/typeconv.sgml b/doc/src/sgml/typeconv.sgml index b53dbe4e75d..58427d205de 100644 --- a/doc/src/sgml/typeconv.sgml +++ b/doc/src/sgml/typeconv.sgml @@ -228,7 +228,32 @@ should use this new function and will no longer do the implicit conversion using <step performance="required"> <para> -Check for an exact match in the <classname>pg_operator</classname> system catalog. +Select the operators to be considered from the +<classname>pg_operator</classname> system catalog. If an unqualified +operator name is used (the usual case), the operators +considered are those of the right name and argument count that are +visible in the current search path (see <xref linkend="sql-naming">). +If a qualified operator name was given, only operators in the specified +schema are considered. +</para> + +<substeps> +<step performance="optional"> +<para> +If the search path finds multiple operators of identical argument types, +only the one appearing earliest in the path is considered. But operators of +different argument types are considered on an equal footing regardless of +search path position. +</para> +</step> +</substeps> +</step> + +<step performance="required"> +<para> +Check for an operator accepting exactly the input argument types. +If one exists (there can be only one exact match in the set of +operators considered), use it. </para> <substeps> @@ -250,10 +275,11 @@ Look for the best match. <substeps> <step performance="required"> <para> -Make a list of all operators of the same name for which the input types -match or can be coerced to match. (<type>unknown</type> literals are -assumed to be coercible to anything for this purpose.) If there is only -one, use it; else continue to the next step. +Discard candidate operators for which the input types do not match +and cannot be coerced (using an implicit coercion function) to match. +<type>unknown</type> literals are +assumed to be coercible to anything for this purpose. If only one +candidate remains, use it; else continue to the next step. </para> </step> <step performance="required"> @@ -467,13 +493,38 @@ tgl=> select cast(text '20' as int8) ! as "factorial"; <step performance="required"> <para> -Check for an exact match in the <classname>pg_proc</classname> system catalog. +Select the functions to be considered from the +<classname>pg_proc</classname> system catalog. If an unqualified +function name is used, the functions +considered are those of the right name and argument count that are +visible in the current search path (see <xref linkend="sql-naming">). +If a qualified function name was given, only functions in the specified +schema are considered. +</para> + +<substeps> +<step performance="optional"> +<para> +If the search path finds multiple functions of identical argument types, +only the one appearing earliest in the path is considered. But functions of +different argument types are considered on an equal footing regardless of +search path position. +</para> +</step> +</substeps> +</step> + +<step performance="required"> +<para> +Check for a function accepting exactly the input argument types. +If one exists (there can be only one exact match in the set of +functions considered), use it. (Cases involving <type>unknown</type> will never find a match at this step.) </para></step> <step performance="required"> <para> -If no exact match appears in the catalog, see whether the function call appears +If no exact match is found, see whether the function call appears to be a trivial type coercion request. This happens if the function call has just one argument and the function name is the same as the (internal) name of some data type. Furthermore, the function argument must be either @@ -489,11 +540,11 @@ Look for the best match. <substeps> <step performance="required"> <para> -Make a list of all functions of the same name with the same number of -arguments for which the input types -match or can be coerced to match. (<type>unknown</type> literals are -assumed to be coercible to anything for this purpose.) If there is only -one, use it; else continue to the next step. +Discard candidate functions for which the input types do not match +and cannot be coerced (using an implicit coercion function) to match. +<type>unknown</type> literals are +assumed to be coercible to anything for this purpose. If only one +candidate remains, use it; else continue to the next step. </para> </step> <step performance="required"> |