Re: MySQL Compatibility WAS: 8.5 release timetable, again
От | Greg Stark |
---|---|
Тема | Re: MySQL Compatibility WAS: 8.5 release timetable, again |
Дата | |
Msg-id | 407d949e0908261904g3440b4b8w7516cb0c55b87f3c@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: MySQL Compatibility WAS: 8.5 release timetable, again (Tom Lane <tgl@sss.pgh.pa.us>) |
Список | pgsql-hackers |
On Thu, Aug 27, 2009 at 1:24 AM, Tom Lane<tgl@sss.pgh.pa.us> wrote: > Greg Stark <gsstark@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
В списке pgsql-hackers по дате отправления: