pgsql-bugs(at)postgresql(dot)org writes:
> If a byte string that is not valid unicode is inserted into a bytea
> column, analyze will fail unless the data was tagged as bytea in the
> insert.
Your example produces no failure for me. You'd better be more specific
about which PG version you're running, on what platform, with what
configure options and what database encoding, etc.
regards, tom lane