
  Running postgres-7.0.3 on a RedHat 6.2 system:

  Recently I updated the schema of one of our tables (create, insert
select, drop, rename).  We have a boolean column "hitsingle" with a default
of 'f'.

media=> \d incantaaudioclipregistry
           Table "incantaaudioclipregistry"
   Attribute    |     Type     |       Modifier       
----------------+--------------+----------------------
...
 releasedate    | integer      | not null
...
 hitsingle      | boolean      | not null default 'f'
...

  Lately newly inserted rows have been coming up with a value of 't', even
though that column is not mentioned in the insert (and therefore should get
the default value).

media=> select releasedate, hitsingle, count(*) from incantaaudioclipregistry group by releasedate, hitsingle;

 releasedate | hitsingle | count 
-------------+-----------+-------
...
        1237 | f         |  1984
        1237 | t         |    31
        1237 | t         |   429
        1239 | f         |   264
        1239 | t         |    26
        1239 | t         |   669
...

  WTF is that?!

media=> select count(*) from incantaaudioclipregistry where hitsingle and not hitsingle = 't';
 count 
-------
  1098
(1 row)

  So, I have T and no T!

  I tried replicating the problem on a small scale and couldn't.  I can't
even replicate it in the database with problems.  Sigh.

  I have made copies of the files in base/media/ just in case somebody out
there could perform a forensic analysis.

Tue, 12 Jun 2001 11:37:37 -0400
Robert Forsman <thoth@purplefrog.com>
freaky results