db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Finn <m...@bitcount.com>
Subject Re: Postgres aapter bug
Date Tue, 29 Apr 2003 22:19:48 GMT
Well,
I guess im not really sure whether the booleanchar will work at all, 
then.. In the village source the Value class defines isTrue as follows:

     /**
      * @return true if (true || t | yes | 1)
      */
     private boolean isTrue(String value)
     {
         return (value.equalsIgnoreCase ("true") ||
                 value.equalsIgnoreCase ("t") ||
                 value.equalsIgnoreCase ("yes") ||
                 value.equals ("1"));
     }

It doesn't check for Y/N. This is what torque uses to grab the boolean 
value from the db.. So I guess if torque used T/F or 0/1 for booleanchar 
vals, all would be in good harmony along with the '0'/'1' fix in postgres.

-matt


James A. Hillyerd wrote:
> Hi Matt,
> 
> I like your idea.  Seems like postgres will let you select against all
> three of those column types with a '0' or '1', I was expecting it to
> barf on the int2.
> 
> I think we may run into problems with inserts though, since Torque uses
> 'Y' and 'N' for booleanchar values.
> 
> -james
> 
> On Mon, 2003-04-28 at 19:35, Matt Finn wrote:
> 
>>Hi,
>>
>>I have also been afflicted with that problem.
>>How about using single quotes for booleans ('0' and '1')? This works 
>>fine with 7.2 and 7.3 postgres across all three types, although I 
>>haven't tested any earlier versions.
>>
>>postgres=# create table test (one boolean, two char, three int2);
>>CREATE TABLE
>>postgres=# insert into test (one,two,three) values ('0','0','0');
>>INSERT 43810 1
>>postgres=# insert into test (one,two,three) values ('1','1','1');
>>INSERT 43811 1
>>postgres=# select * from test;
>>  one | two | three
>>-----+-----+-------
>>    0 | f   | 0
>>    1 | t   | 1
>>(2 rows)
>>
>>postgres=#
>>
>>
>>-matt
>>
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
>>For additional commands, e-mail: torque-dev-help@db.apache.org



Mime
View raw message