On Thu, Aug 27, 2009 at 1:24 AM, Tom Lane<t...@sss.pgh.pa.us> wrote: > Greg Stark <gsst...@mit.edu> writes: >> Actually it always bothered me that we don't have implicit casts from >> integer->boolean. I can't see any ambiguity or unintentional effects >> this would cause problems with. Am I missing something? > > Personally, as an old Pascal-lover, I always thought that C's failure > to distinguish between int and boolean was the single biggest design > mistake in the language. I'm very glad that SQL doesn't make that > mistake, and I don't want to go against the standard to introduce it.
I'm sure I can think of bigger flaws in C than that :) I tend to think SQL has more in common with lisp than either of those, perhaps because of the tinge of functional programming style. But I think you're generalizing my suggestion to the point of building a straw man to say "failure to distinguish". You could argue that using a boolean in places where integers are expected could be confusing or dangerous. But using other data types where boolean values are expected is perfectly reasonable and safe -- especially in cases like integer where people do expect it to work and the behaviour is very predictable. -- greg http://mit.edu/~gsstark/resume.pdf -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers