Josh Berkus <j...@agliodbs.com> writes: > The root cause of this is that we treat "default TEXT" the same as "real > TEXT" as a type.
No, we do not do that at all. A NULL is initially of type unknown, and that is definitely not the same as text. The type resolution rules treat the two cases differently. The real cause of what David is complaining about is that we resolve expression datatypes bottom up. Once we've determined that we're going to consider foo(NULL) as an invocation of foo(text), that's what it is, and the context won't cause us to go back and change that. > Changing that logic, though, would require a massive > refactoring and debugging of PostgreSQL. This is true enough; and you forgot to mention all the existing applications that would also need changes if we changed the expression resolution rules. We could possibly make marginal changes without too much pain, but making function resolution context-dependent would hardly be a marginal change. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers