Tom Lane <tgl@sss.pgh.pa.us> writes:
> Greg Stark <gsstark@mit.edu> writes:
> > "Jesper K. Pedersen" <jkp@solnet.homeip.net> writes:
> >> Having checked the I/O format it seems that MS Access exports the
> >> values of a YESNO field as 0 and 1
>
> > If only Postgres's boolean type were as helpful.
>
> There's a cast to int in 8.1, and you can roll-your-own easily in prior
> releases ...
The annoying thing about is that in just about any client language you'll get
't' and 'f' by default and both will evaluate to false. So any user who tries
to do things the obvious way like this will get a surprise:
if ($db->query("select canlogin from users where userid = ?",$userid)) { ...}
Is there an implicit cast from ints? So if I pass a 0 or 1 argument for a
boolean parameter now it'll work? That definitely didn't work in the past.
--
greg