Hello again. So I've run my test against these 16 databases. These ones
behave like Oracle (boolean true can be inserted into char(1))

- Firebird (inserts Y or N)
- HSQLDB
- IBM DB2
- MariaDB
- Microsoft Access
- MySQL
- Oracle
- SQL Server
- Sybase

These ones behave like PostgreSQL (boolean true cannot be inserted into
char(1))

- CUBRID
- Derby
- H2
- Ingres
- PostgreSQL
- SQLite

I'll let you decide how to interpret this information :-)

Cheers
Lukas



2014-02-13 21:40 GMT+01:00 Lukas Eder <[email protected]>:

> Yes, strict type checking is certainly desirable. I've checked the latest
> draft documents of the the SQL:2011 standard. The PostgreSQL driver shows
> the expected behaviour when we use a CAST:
>
> 6.13 <cast specification>
> [...]
> 10) If TD is fixed-length character string, then let LTD be the length in
> characters of TD.
> [...]
> e) If SD is boolean, then
> Case:
> i) If SV is True and LTD is not less than 4, then TV is 'TRUE' extended on
> the right by LTD-4
> <space>s.
> ii) If SV is False and LTD is not less than 5, then TV is 'FALSE' extended
> on the right by LTD-5
> <space>s.
> iii) Otherwise, an exception condition is raised: data exception -- invalid
> character value for cast.
>
>
> A similar specification is available for VARCHAR. Informally speaking, TV
> is a value of type TD and SV is a value of type SD such that TV = CAST(SV
> AS TD).
>
> It's generally good to follow the standard, but from an interoperability
> perspective, a more relaxed interpretation might be valuable as well.
>
> 2014-02-13 14:35 GMT+01:00 Rami Ojares <[email protected]>:
>
> I vote for strict type checking.
>> This means that setting a value with wrong type should produce an error.
>> Maybe someone has saved his booleans as "T" and "F" or "t" and "f" or
>> "true" and "false" or "yes" and "no" ...
>>
>> Of course as a compatibility feature for different modes it is defendable.
>>
>> - Rami
>>
>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "H2 Database" group.
>> To unsubscribe from this topic, visit https://groups.google.com/d/
>> topic/h2-database/me_teu3Shbc/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at http://groups.google.com/group/h2-database.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to