This "bug" was heavily commented on but the behavior was never changed:
Welcome to psql 8.0.0beta2, the PostgreSQL interactive terminal.
Type: \copyright for distribution terms \h for help with SQL commands \? for help with psql commands \g
orterminate with semicolon to execute query \q to quit
alvherre=# select 123456789012345678901234567890 % 123; ?column?
---------- -6
(1 fila)
The most relevant part of the thread is here:
http://archives.postgresql.org/pgsql-general/2004-04/msg01065.php
--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
Thou shalt check the array bounds of all strings (indeed, all arrays), for
surely where thou typest "foo" someone someday shall type
"supercalifragilisticexpialidocious" (5th Commandment for C programmers)