You cannot reproduce the same effect on SQL Fiddle.
I recreated your table in Postgres 9.1.13 (always upgrade to the latest point release!) and ran the queries in pgAdmin (current version 1.18.1). I cannot reproduce the problem.
pgAdmin?
I don't see how pgAdmin could play a role in this - unless you have been selecting only a part of your query, unaware of this effect:
pgAdmin shortcuts to execute scripts
Or you might be fooled by the "Max. characters per column" setting, which truncates long values in the display, hiding the match in the truncated part, like @IMSoP suggested in his comment. Check File -> Options ...
If that's not it and unless we are dealing with typos or circumstances not in your question, this would indicate something is broken in your database.
Corruption?
In simple cases with just a corrupted index, a REINDEX TABLE
might do the trick:
REINDEX TABLE messages;
However, on a closer look, I don't see an index that could possibly be the culprit here.
Corrupted system catalog? Read this first:
http://wiki.postgresql.org/wiki/Corruption
Then read the Notes section for REINDEX
and run from the shell:
$ export PGOPTIONS="-P"
$ psql broken_db
...
broken_db=> REINDEX DATABASE broken_db;
broken_db=> \q
Corruption often indicates a problem with your hardware. A failing disk or something. Follow up on that ...
Related question:
Repair Corrupt database postgresql