There is no more problem. All this has been caused by a postgre Manager that seems it was bringing data from memory and not from server. The truth of all it's tha there where no records and php was working ok.
Sorry about it.
The Postgre Manager I've been using it's EMS PostreSql Manager. Seems to be good but not so good. I had to use phpPgAdmin to realize what the problem was.