Обсуждение: Out of memory

Поиск
Список
Период
Сортировка

Out of memory

От
Johann Spies
Дата:
On a computer with 2G Ram running Debian Squeeze and Postgresql 8.4.8-0squeeze2
I made a dump using 'pg_dump kb > kb.sql'.

I copied the file to another computer with 8G RAM running Debian
wheezy/sid/Postgresql 8.4.8-2 and tried to load that data by running
'psql -f kb.sql' - a process which produced a lot of errors ending with


psql:kb.sql:4189263: invalid command \N
psql:kb.sql:4189277: invalid command \N
psql:kb.sql:4189278: invalid command \N
psql:kb.sql:4189279: invalid command \nMost
psql:kb.sql:4189280: invalid command \N
psql:kb.sql:4189281: invalid command \N
psql:kb.sql:4189282: invalid command \N
psql:kb.sql:4189283: invalid command \N
psql:kb.sql:4189284: invalid command \N
psql:kb.sql:7991569: ERROR:  out of memory
DETAIL:  Cannot enlarge string buffer containing 0 bytes by 1311240426 more bytes.


What is causing the 'invalid command' lines?
And the memory problem?

There are several foreign keys in the database.


Regards
Johann
--
Johann Spies                            Telefoon: 021-808 4699
Databestuurder /  Data manager

Sentrum vir Navorsing oor Evaluasie, Wetenskap en Tegnologie
Centre for Research on Evaluation, Science and Technology
Universiteit Stellenbosch.

     "Children, obey your parents in the Lord: for this is
      right."             Ephesians 6:1

Re: Out of memory

От
Tom Lane
Дата:
Johann Spies <jspies@sun.ac.za> writes:
> On a computer with 2G Ram running Debian Squeeze and Postgresql 8.4.8-0squeeze2
> I made a dump using 'pg_dump kb > kb.sql'.

> I copied the file to another computer with 8G RAM running Debian
> wheezy/sid/Postgresql 8.4.8-2 and tried to load that data by running
> 'psql -f kb.sql' - a process which produced a lot of errors ending with

> psql:kb.sql:4189263: invalid command \N
> psql:kb.sql:4189277: invalid command \N

Almost always, when you get a cascade of error messages, the thing to
look at is the *first* error, or first few errors.  Not the last ones.

In this case I'd guess that a COPY command failed and psql is now trying
to process the COPY data as SQL commands, but you'll never be able to
tell any more than that without seeing the error message that the COPY
reported.

            regards, tom lane

Re: Out of memory

От
Johann Spies
Дата:
On Thu, Jul 21, 2011 at 04:36:56PM +0200, Tom Lane wrote:
>
> Almost always, when you get a cascade of error messages, the thing to
> look at is the *first* error, or first few errors.  Not the last ones.
>
> In this case I'd guess that a COPY command failed and psql is now trying
> to process the COPY data as SQL commands, but you'll never be able to
> tell any more than that without seeing the error message that the COPY
> reported.
>

Thanks Tom. That is something that makes a lot of sense.

I have done two things and one or both of them made a difference:
moved the database to a partition with more free space and I deleted and
recreated the database.

I could successfully import the data now.


Regards
Johann

--
Johann Spies                            Telefoon: 021-808 4699
Databestuurder /  Data manager

Sentrum vir Navorsing oor Evaluasie, Wetenskap en Tegnologie
Centre for Research on Evaluation, Science and Technology
Universiteit Stellenbosch.

     "Children, obey your parents in the Lord: for this is
      right."             Ephesians 6:1