> Econtre este: > http://archives.postgresql.org/pgsql-sql/2002-09/msg00343.php >
Roberto, Creo que el thread que pasó Emanuel da en el clavo. Allí Tom Lane tira una pista por donde indagar. Cito: And, in fact, this is the typical behavior when it runs out of memory for the result set :-( ... it loses track of the fact that it was receiving a result set at all, and starts spitting out complaints that it's not in the right state as it receives subsequent rows. (That should be fixed someday, but no one's got round to it.) Consider using a cursor so you can FETCH a reasonable number of rows at a time. Traduciendo: dice que los errores que recibiste es el comportamiento en viejas versiones del cliente cuando se queda sin memoria. A ello sugiere usar un cursor para traer una cantidad limitada de filas por vez. ¿En tu consulta estás trayendo los 11 millones de registro? Para confirmar que este es efectivamente el problema podrías monitorear el consumo de memoria mientras ejecuta la consulta. Si pasar a una versión de psql más reciente no es una opción tendrás que evaluar como particionar tu consulta para traer las filas de a lotes reducidos. Saludos, Fernando. -- TIP 4: No hagas 'kill -9' a postmaster