Fwd: [development] Moderation bit behavior

Khalid B kb at 2bits.com
Wed Jul 5 17:42:26 UTC 2006

> There is nothing wrong with having separate bit-fields in the
> database.  It's easy to use, easy to write SQL queries for, and
> probably faster as you don't have to do binary operations in the SQL
> queries.  Keep it simple.

Here is more:

They can only be On or Off, and cannot mean anything else. If you want
another state, you cannot get it from the current column, you have to create
a new one.

Grouping by a bit is not as simple or elegant or fast as grouping by a column
(involves a function at minimum).

What about database portability/abstraction? From what little I know Postgres
can have a problem with this (gurus, please confirm/debunk).

Since this is a database, a column for each "meaning" is far better.

It makes sense to use bitwise fields for operating systems, or systems
but otherwise, distinct fields are better.

More information about the development mailing list