Sepertinya post_id bertipe TEXT bukan INTEGER. Untuk memperbaikinya, Anda harus mengubah tipe data. Ini telah diubah di versi 8.3, versi yang lebih lama memiliki pemeran implisit. Anda dapat memberi tahu PostgreSQL untuk melakukannya:
CREATE FUNCTION pg_catalog.text(integer) RETURNS text STRICT IMMUTABLE LANGUAGE SQL AS 'SELECT textin(int4out($1));';
CREATE CAST (integer AS text) WITH FUNCTION pg_catalog.text(integer) AS IMPLICIT;
CREATE FUNCTION pg_catalog.text(smallint) RETURNS text STRICT IMMUTABLE LANGUAGE SQL AS 'SELECT textin(int2out($1));';
CREATE CAST (smallint AS text) WITH FUNCTION pg_catalog.text(smallint) AS IMPLICIT;
CREATE FUNCTION pg_catalog.text(bigint) RETURNS text STRICT IMMUTABLE LANGUAGE SQL AS 'SELECT textin(int8out($1));';
CREATE CAST (bigint AS text) WITH FUNCTION pg_catalog.text(bigint) AS IMPLICIT;
Lihat juga http://wiki.postgresql.org/wiki/Image :Pg83-implicit-casts.sql