Re: boolean isn't boolean?
От | Peter Eisentraut |
---|---|
Тема | Re: boolean isn't boolean? |
Дата | |
Msg-id | Pine.LNX.4.21.0006220407560.19929-100000@localhost.localdomain обсуждение исходный текст |
Ответ на | boolean isn't boolean? (Marc Britten <mbritten@cybernet-usa.com>) |
Список | pgsql-general |
Marc Britten writes: > why does a boolean value return a t or an f? The language-lawyer version: ISO/IEC 9075-5:1999 ("SQL99") 17.2 GR6 "If [the result of the query expression] is not empty, then [it] is returned. The method of returning [it] is implementation-defined." Then that's how this implementation defines it. :-) > and i have to check for $myarray[3] == 't' if i want to check for a true > value? why? The native libpq C API returns all data as text. It is up to the interface that is build on libpq to do something useful with the data. For example, embedded SQL will map query data to appropriate C data types, although I'm not sure what it would do with boolean in particular. Similar things go for ODBC and JDBC. So the fact is that you need to take it up with the PHP (I guess?) guys to translate boolean values to defined/undefined or whatever they prefer to use. But since they'd probably not break compatibility like that you should probably provide your own wrapper class/function/etc. -- Peter Eisentraut Sernanders väg 10:115 peter_e@gmx.net 75262 Uppsala http://yi.org/peter-e/ Sweden
В списке pgsql-general по дате отправления: