Ok, I think, I have found some answers:

(1) My current version is 2.9.11 (source) and I have checked it some
minutes ago:
http://www.web2py.com/examples/static/web2py_src.zip does not contain a
dal/-folder but a dal.py

(2) I have found the dal/-folder now in version 2.9.12 Beta.

(3) I am sorry but the lines TRUE = 'True' and so on are not parts of the
offical file - my mistake, I think I have got it from an experimental
version. Maybe I have tried few months ago something like this proposal:
https://github.com/web2py/web2py/pull/580/files

Sorry again for this misleading discussion.

2015-01-07 17:52 GMT+01:00 Massimo Di Pierro <[email protected]>:

> I am pretty sure this worked fine. That said... we did a lot of
> refactoring of dal recently and that could have caused the problem. But, I
> am very confused. If you have a recent dal version you should not have a
> dal.py file. You should have a dal/ folder.
>
> What version of web2py do you have?
>
>
> On Wednesday, 7 January 2015 08:44:23 UTC-6, mweissen wrote:
>>
>> Let's say I create a table with
>> db.define_table('booltest', Field('b', 'boolean'))
>>
>> web2py generates something like
>> CREATE TABLE booltest (b char(1));
>>
>> Now we will insert a new record
>> db.booltest.insert(b=True);
>>
>> The error message is
>> "Wert zu lang für Typ character(1)"
>> which means
>> "Value too long for character(1)"
>>
>> Why? Because the generates SQL-statement is
>> INSERT INTO booltest(b) VALUES ('True') RETURNING id;
>>
>> But if I would create a table with
>> CREATE TABLE booltest (b boolean);
>> the following SQL-statements work.
>> Try it with the command line interface of postgres.
>>
>> INSERT INTO bootest2 (b) VALUES('true');
>> INSERT INTO bootest2 (b) VALUES(TRUE);
>> INSERT INTO bootest2 (b) VALUES(true);
>> INSERT INTO bootest2 (b) VALUES(True);
>> INSERT INTO bootest2 (b) VALUES('T');
>> INSERT INTO bootest2 (b) VALUES('on');
>>
>>
>> Therefore I think the following lines should be changed in gluon/dal.py,
>> after line 2760 (class PostgreSQLAdapter(BaseAdapter);
>>
>> TRUE = 'True'       ==>   TRUE = 'T'
>> FALSE = 'False'      ==>   FALSE = 'F'
>>
>> or, better:
>>
>> types = {'boolean': 'CHAR(1)',   ==> types = {'boolean': 'BOOLEAN',
>>
>> Right? Or did I made a mistake?
>> I cann't image that I am the first one with this problem...
>>
>> Regards, Martin
>>
>>
>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to