On Wed, Sep 2, 2009 at 3:44 PM, Jeff Davis<pg...@j-davis.com> wrote: > On Wed, 2009-09-02 at 08:57 -0500, Kevin Grittner wrote: >> > (a) leaving a literal as "unknown" until you've finished >> > inferring types (current behavior) >> > (b) casting every unknown to text immediately, and then trying to >> > infer the types >> >> No, that's not it. I'm wondering why it isn't treated as text. >> Period. Full stop. Nothing to infer. Anywhere that we have implicit >> casts defined from text to something else could, of course, still >> operate; but it would be text. No guessing. > > If you have very many implicit casts, I think you lose the > predictability and safety you're looking for, and/or end up with a lot > of errors that eliminate the convenience of implicit casting.
Perhaps we should stop thinking of "unknown" as, er, "unknown" and think of it as "text literal". A text literal has implicit casts to every data type but a normal text string has to be explicitly cast. Hm, that's not quite right because things like array(1)||'5' don't treat the '5' as a text literal. The "implicit cast" is preferred to treating it as text. -- greg http://mit.edu/~gsstark/resume.pdf -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs