On 2000-02-21, Tom Lane mentioned:
> I've been ranting about this in a recent pghackers thread ;-).
> The lexer shouldn't have to commit to a conversion to float8
> in order to report that a token looks like a numeric literal.
Has the ranting resulted in any idea yet? ISTM that keeping a non-integer
number as a string all the way to the executor shouldn't hurt too much.
After all, according to SQL 123.45 *is* a NUMERIC literal! By making it a
float we're making our users liable to breaking all kinds of fiscal
regulations in some places. (Ask Jan.)
> The resulting error message
> ERROR: Unable to convert left operator '-' from type 'unknown'
> isn't exactly up to a high standard of clarity either;
Speaking of 'unknown', this is my favourite brain-damaged query of all
times:
peter=> select 'a' like 'a';
ERROR: Unable to identify an operator '~~' for types 'unknown' and 'unknown' You will have to retype this query
usingan explicit cast
Is there a good reason that a character literal is unknown? I'm sure the
reasons lie somewhere in the extensible type system, but if I wanted it to
be something else explicitly then I would have written DATE 'yesterday'.
--
Peter Eisentraut Sernanders väg 10:115
peter_e@gmx.net 75262 Uppsala
http://yi.org/peter-e/ Sweden