On Jun26, 2011, at 00:29 , Jeff Davis wrote:
> declare the return type of a function, and then use the declared type to
> infer the argument types. That would be nice because you would just have
> to do:
>  range(1,10)::int8range
> However, that's kind of backwards from how our type inference system
> works now, and sounds like a big change.

Well, there actually *is* some precedence for that kind of top-down
(form a syntactic perspective) type inference. We *enforce* the cast
in 
  array[]::<arraytype>
and actually for a very similar reason - without the case, there's no
way of knowing which type of empty array was meant. I think we also
special-case
  'literal'::<type>
to use the input function of type directly, instead of first creating
a text value and later casting it to <type>.

best regards,
Florian Pflug


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to