Re: Postgres crashed when adding a sequence column - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: Postgres crashed when adding a sequence column
Date
Msg-id 20050119111332.GC18648@svana.org
Whole thread Raw
In response to Postgres crashed when adding a sequence column  (Clive Page <cgp@star.le.ac.uk>)
List pgsql-general
On Wed, Jan 19, 2005 at 09:35:15AM +0000, Clive Page wrote:
> I have a largish table (71 million rows) to which I needed to add a new
> integer column containing a unique identifier - a simple sequence seemed
> to be good enough.  I discovered the CREATE SEQUENCE command which looked
> as if it would do the job, and did the following:
>
> ALTER TABLE intwfs ADD COLUMN id int ;
> CREATE SEQUENCE myseq;
> UPDATE intwfs SET id = nextval('myseq');

You're not doing anything unusual there. Do you have any deferred
constrints or foreign keys. I can't think of anything else that might
take memory during the transaction.

The pg_dump output of the schema of that table would clear this up
probably.

Hope this helps,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

Attachment

pgsql-general by date:

Previous
From: Richard Huxton
Date:
Subject: Re: Postgres crashed when adding a sequence column
Next
From: Clive Page
Date:
Subject: Re: Postgres crashed when adding a sequence column