On Fri, Jan 30, 2009 at 8:43 PM, Russell Keith-Magee
<[email protected]> wrote:
> Can you clarify what you mean here - is it case of 'doesn't have these
> operators in any form', or 'has these operators, but uses different
> characters/functions? You answer this below for the bitwise operators,
> but what about %? How does Oracle implement mod?

Modulo is implemented as `mod(x, y)`.  Bit-wise and is implemented as
`bitand(x, y)`.  Bit-wise or is, as noted, not built in.

> To a limited extent, we've actually already hit this problem with
> Postgres. Postgres doesn't support the % operator with floats, for
> example, whereas SQLite and MySQL do. The decision that was made at
> the time:
>
> http://groups.google.com/group/django-developers/browse_thread/thread/c8cff7e5e16c692a
>
> was to accept that the backends all have different capabilities, and
> while complete backend independence is a laudable goal, it just isn't
> practical. We already have some backend-specific incompatibilities
> (such as the handling of case sensitivity on some MySQL collations,
> and the forward-referencing problem with MySQL)
>
> However, your idea about pushing this evaluation into connection.ops,
> and providing the ability to use function calls in addition to simple
> infix notation sounds like a good idea to me. A separate thread has
> already raised similar questions in the context of operations on date
> fields (e.g., add 3 days). Some backends may require function calls to
> handle date expressions. Operations on strings are also possible
> candidates here.

This makes sense.  I see no reason not to get % and & working, since
there's nothing fundamentally preventing it.  Bit-wise or is lower
priority, and while we could emulate it with the formula I mentioned
before, a savvy user could employ the same formula without modifying
Django at all.

Ian

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to