[Nottingham] SQLite and 'locking'

Martin Garton martin at stupids.org
Tue Feb 27 11:34:35 GMT 2007

On Tue, 2007-02-27 at 11:21 +0000, Duncan John Fyfe wrote:

> If you use NULL to flag 'available' how do you record a seat as
> 'unavailable and not booked' (eg. seat 10 has been broken) ?
> Here is a new perfectly reasonable 'not booked' state.

Fair point.  For this simple example I was assuming the only reason a
seat would not be available was because it was booked.  How would you
handle this case?  With an additional "broken seats" table?

> This isn't just about normalisation, this is about the sane encoding of
> meaning and the preservation of sanity by not being lured into a false
> sense of convenience by misusing NULL.  Take for example perl DBI which
> translates an undef (uninitialised)  variables into a NULL in the DB.
> This is a very good non-normalisation reason to avoid NULL's like the
> plague - any automatic undef <=> NULL mapping hides coding errors and
> allows simple errors to ruin your database.

Do you mean for columns where NULL has no meaning that you have ascribed
to it?  I don't yet see what alternative prevents coding errors.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
Url : http://mailman.lug.org.uk/pipermail/nottingham/attachments/20070227/8d6d4263/attachment.bin

More information about the Nottingham mailing list