Re: Query Failed, out of memory

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Query Failed, out of memory
Дата
Msg-id 14200.1160064084@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Query Failed, out of memory  ("Mark Woodward" <pgsql@mohawksoft.com>)
Ответы Re: Query Failed, out of memory  ("Mark Woodward" <pgsql@mohawksoft.com>)
Re: Query Failed, out of memory  (Andrew Dunstan <andrew@dunslane.net>)
Список pgsql-hackers
"Mark Woodward" <pgsql@mohawksoft.com> writes:
> psql -p 5435 -U pgsql -t -A -c "select client, item, rating, day from
> ratings order by client" netflix > netflix.txt

> My question, it looks like the kernel killed psql, and not postmaster.

Not too surprising.

> Question, is this a bug in psql?

It's really a libpq design issue: since libpq provides random access to
a PGresult, and has no mechanism for handling failures after returning
the PGresult to the client, it has to slurp the whole query result into
memory first.

FWIW, there's a feature in CVS HEAD to instruct psql to try to use a
cursor to break up huge query results like this.  For the moment I'd
suggest using COPY instead.
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: AgentM
Дата:
Сообщение: Re: Query Failed, out of memory
Следующее
От: "Mark Woodward"
Дата:
Сообщение: Re: Query Failed, out of memory