pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Joshua D. Drake <jd@commandprompt.com>
To: WernerBohl@infutor.com
Cc: PgSQL ADMIN <pgsql-admin@postgresql.org>
Subject: Re: PG 8 Out of memory issuing queries
Date: Fri, 04 Feb 2005 17:36:13 -0800
Message-ID: <4204230D.9050900@commandprompt.com> (raw)
In-Reply-To: <1107553146.16535.6.camel@sirio>
References: <1107553146.16535.6.camel@sirio>

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

Attachments:

jd.vcf (text/x-vcard, 638B) download begin:vcard fn:Joshua D. Drake n:Drake;Joshua D. org:Command Prompt, Inc. adr:;;PO Box 215;Cascade Locks;Oregon;97014;USA email;internet:jd@commandprompt.com title:Consultant tel;work:503-667-4564 tel;fax:503-210-0334 note:Command Prompt, Inc. is the largest and oldest US based commercial PostgreSQL support provider. We provide the only commercially viable integrated PostgreSQL replication solution, but also custom programming, and support. We authored the book Practical PostgreSQL, the procedural language plPHP, and adding trigger capability to plPerl. x-mozilla-html:FALSE url:http://www.commandprompt.com/ version:2.1 end:vcard

view thread (2+ messages)

Message-ID: <4204230D.9050900@commandprompt.com>
Permalink:  ../4204230D.9050900@commandprompt.com/
Also on:    postgresql.org/message-id/4204230D.9050900@commandprompt.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: jd@commandprompt.com, WernerBohl@infutor.com
  Subject: Re: PG 8 Out of memory issuing queries
  In-Reply-To: <4204230D.9050900@commandprompt.com>
  References: <1107553146.16535.6.camel@sirio> <4204230D.9050900@commandprompt.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox