freaky results - Mailing list pgsql-hackers

From Robert Forsman
Subject freaky results
Date
Msg-id 200106121537.LAA02772@nile.purplefrog.com
Whole thread Raw
List pgsql-hackers
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.


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: inet/cidr wierdness (casting)
Next
From: Peter Eisentraut
Date:
Subject: Re: Re: [PATCHES] Fw: Isn't pg_statistic a security hole - Solution Proposal