Re: PG 8 Out of memory issuing queries

From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: WernerBohl(at)infutor(dot)com
Cc: PgSQL ADMIN <pgsql-admin(at)postgresql(dot)org>
Subject: Re: PG 8 Out of memory issuing queries
Date: 2005-02-05 01:36:13
Message-ID: 4204230D.9050900@commandprompt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Werner Bohl wrote:
> Hi!
>
> Hope anybody can help me with this issue. I have a fairly large table
> (~75 million rows) that where imported without pk. Tried to create a pk
> on a supposed unique field, but failed with duplicates. So i issued:
> select oldid from table group by oldid having count(*) > 1
> and it fails with Out of memory. Tried to create a new pk using: alter
> table <table> add newid serial primary key; and it also fails with out
> of memory error.

Use a cursor during your large count(*) query and you can find you bad
entries.

J

>
> Are there any settings on postgresql.conf that I may change to prevent
> this error?
>
> This is on Windows XP profesional with Postgresql 8.0
>
>
> TIA,
>

--
Command Prompt, Inc., your source for PostgreSQL replication,
professional support, programming, managed services, shared
and dedicated hosting. Home of the Open Source Projects plPHP,
plPerlNG, pgManage, and pgPHPtoolkit.
Contact us now at: +1-503-667-4564 - http://www.commandprompt.com

Attachment Content-Type Size
jd.vcf text/x-vcard 640 bytes

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Pascal Van Puymbroeck 2005-02-05 09:16:22 Performance issue
Previous Message Simon Riggs 2005-02-05 00:12:31 Re: log_duration