DRUPAL 7.33 - When i try to save a node with upload, i receive website encountered unexpected error...PDOException: SQLSTATE[25P02] In my postgresql log i have error on this select:

SELECT base.fid AS fid, base.uid AS uid, base.filename AS filename, base.uri AS uri, base.filemime AS filemime, base.filesize AS filesize, base.status AS status, base.timestamp AS timestamp, base.type AS type
    FROM 
    file_managed base
    WHERE  (base.fid IN  ('resultadopdf_1')) 


The file is uploaded, but the node not... I want to understand why the select compare a field id (integer) with a string...
Someone know where this select is made?

After aplied patch:

PDOException: SQLSTATE[25P02]: In failed sql transaction: 7 ERRO: current transaction has been halted , commands ignored until end of transaction block: SELECT column_name, data_type, column_default FROM information_schema.columns WHERE table_schema = :schema AND table_name = :table AND (data_type = 'bytea' OR (numeric_precision IS NOT NULL AND column_default LIKE :default)); Array ( [:schema] =&gt; public [:table] =&gt; node [:default] =&gt; %nextval% ) em drupal_write_record() (linha 7239 de /var/www/portalunifei/includes/common.inc).


But in then postgrelog shows:

ERRO:  input syntax for integer is invalid: "notaspng" at character 256
COMANDO:  SELECT base.fid AS fid, base.uid AS uid, base.filename AS filename, base.uri AS uri, base.filemime AS filemime, base.filesize AS filesize, base.status AS status, base.timestamp AS timestamp, base.type AS type
    FROM 
    file_managed base
    WHERE  (base.fid IN  ('notaspng')) 
ERRO:  current transaction has been halted , commands ignored until end of transaction block
COMANDO:  SELECT column_name, data_type, column_default FROM information_schema.columns WHERE table_schema = 'public' AND table_name = 'node' AND (data_type = 'bytea' OR (numeric_precision IS NOT NULL AND column_default::text LIKE '%nextval%'))
LOG:  duração: 0.025 ms  comando: ROLLBACK
sorry for the delay, but finally found the solution to my problem ...
https://www.drupal.org/node/1003788

I would like to acknowledge the help of you gave me...