Re: Casting INT4 to BOOL...
От | Sean Chittenden |
---|---|
Тема | Re: Casting INT4 to BOOL... |
Дата | |
Msg-id | A020DEEE-1B2E-11D9-91C8-000A95C705DC@speakeasy.net обсуждение исходный текст |
Ответ на | Re: Casting INT4 to BOOL... (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: Casting INT4 to BOOL...
|
Список | pgsql-patches |
>> Is there any reason why the backend doesn't cast an unquoted integer >> to >> a boolean value? > > Hidden cross-category typecasts are evil. I'd accept this as an > explicit cast ('e' in pg_cast) but not automatic. Alrighty. Do you want an updated patch for the single character tweak or can you futz with it before committing? :) > Also, what about the other direction? Providing a cast in only one > direction is pretty inconsistent. Ah... well, if you want that, I can provide that too. Personally, I could care less about the BOOL->INT direction than INT->BOOL. In C++, any bool value is either 0 or 1 and you can do such weirdness (brokeness?) as: bool val = false; if (val == 0) { /* blah */ } Anyway, with Qt, it converts bool values to integers. I think Qt's probably right on this front in that the value 1 should be considered true and 0 should be considered false. My $0.02. -sc -- Sean Chittenden
В списке pgsql-patches по дате отправления: